Trouble declarig Parameters
Hello and thank you for taking a moment to read this message. Here is my code:
SqlConnection dbConn2 = new SqlConnection(Session["usersconn"].ToString());
SqlCommand sqlCom2 = new SqlCommand("Update tblUser SET DiamondDealerID=@DiamondDealerID", dbConn2);
sqlCom2.Parameters["@DiamondDealerID"].Direction = ParameterDirection.Input;
sqlCom2.Parameters.Add("@DiamondDealerID", SqlDbType.Varchar);
sqlCom2.Parameter["@DiamonDealerId"].Value=DateTime.Now.Year.ToString()+Session["companyid"]+intID ;
dbConn2.Open();
sqlCom2.ExecuteNonQuery();
dbConn2.Close();
I am getting the following error
Must declare the variable '@DiamondDealerID'.
Any help you could provide would be greatly appreciated.
|