Can help me to look into the code...
There is a system error in the code... but i not able to identify it... the store procedure is working fine... but don't know why still got error...
DataSet ds;
string dbConn ="Initial Catalog=Northwind;Data Source=THLEE;Integrated Security=SSPI;";
SqlParameter [] arParms = new SqlParameter[2];
arParms[0] = new SqlParameter("@MedicIc_No", SqlDbType.Int, 10,"Customer_Ic_No");
arParms[0].Direction = ParameterDirection.Input;
arParms[0].Value = txtMedicIC.Text;
arParms[1] = new SqlParameter("@Allergy", SqlDbType.Text, 40,"Customer_Allergy");
arParms[1].Direction = ParameterDirection.Output;
using (SqlConnection conn = new SqlConnection(dbConn) )
{
conn.Open();
using (SqlTransaction trans = conn.BeginTransaction())
{
ds = SqlHelper.ExecuteDataset(trans, commandType.StoredProcedure, "usp_SearchCustomerMedic", arParms);
txtMedicAllergy.Text = arParms[2].Value.ToString();
trans.Commit();
}
conn.Close();
}
|