My table name is Customer
. It has four columns
CustomerId
CustomerName
CustomerAddress
PhoneNo
This is my c# code. I am not ge
You didnt specify the same paramets, (forgot to add "@" do it like:
string query = "insert into Customer(CustomerName,CustomerAddress,PhoneNo) values (@CustNm,'@CustAdd',@Ph)";
SqlCommand myCommand = new SqlCommand(query,myConnection);
myCommand.Parameters.AddWithValue("@CustNm",Print[0].CustomerName);
myCommand.Parameters.AddWithValue("@CustAdd",Print[0].Address);
myCommand.Parameters.AddWithValue("@Ph",Print[0].Telephone);