Urgent:Need help to INSERT information to database
Im using the Data Access Application Block in my application. I can't insert the information successfully into my sql database. No error message come out. Can anybody give me some opinion on this?
using (SqlConnection conn = new SqlConnection(dbConn) )
{
conn.Open();
using (SqlTransaction trans = conn.BeginTransaction())
{
SqlParameter [] arParms = new SqlParameter[2];
arParms[0] = new SqlParameter("@Ic_No", SqlDbType.VarChar,20,"Customer_Ic_No");
arParms[0].Direction = ParameterDirection.Input;
arParms[0].Value = txtIC.Text;
arParms[1] = new SqlParameter("@Name", SqlDbType.Char, 25,"Customer_Name");
arParms[1].Direction = ParameterDirection.Input;
arParms[1].Value = txtName.Text;
sqllHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, "usp_AddCustomerRecord", arParms);
trans.Commit();
}
}
|