Database did not record data inserted. No errors shown. 3 tier design in microsoft visual studios 2010
-
Saturday, January 19, 2013 11:35 AM
This is my INSERT statement into the Database. The Database did not record any data after i clicked the button. No errors are shown.
sql = new StringBuilder();
sql.AppendLine("INSERT INTO PaymentNANO (PaymentID,PaymentType, TotalAmount, DateTime1)");
sql.AppendLine("VALUES (@PaymentID, @PaymentType, @TotalAmount, @DateTime1)");
//(PaymentType, TotalAmount, DateTime1)
try
{
conn.Open();
sqlCmd = new SqlCommand(sql.ToString(), conn);
sqlCmd.Parameters.AddWithValue("@PaymentID", PaymentID);
sqlCmd.Parameters.AddWithValue("@PaymentType", PaymentType);
sqlCmd.Parameters.AddWithValue("@TotalAmount", TotalAmount);
sqlCmd.Parameters.AddWithValue("@DateTime1", DateTime1);
result = sqlCmd.ExecuteNonQuery();
}
catch (Exception ex)
{
errMsg = ex.Message;
}
finally
{
conn.Close();
}
return result;
}Any idea why?
- Edited by PleaseHelpMeSOS Saturday, January 19, 2013 11:41 AM
- Edited by PleaseHelpMeSOS Saturday, January 19, 2013 11:49 AM
All Replies
-
Saturday, January 19, 2013 8:39 PMPlease try to refresh the table in the Management Studio.
mysorian
-
Sunday, January 20, 2013 9:20 AM

