Skip to content Skip to sidebar Skip to footer

Must Declare The Scalar Variable @firstname

I am using parameterised query but I got an error - how can I solve it? Here is my code SqlCommand cmd = new SqlCommand(); string sql = @'insert into Student_Records (FirstName,La

Solution 1:

using (SqlCommand cmd = new SqlCommand("Add your insert cmd", connection)) {
   cmd.Parameters.AddWithValue("@firstname", txtFname.Text);
   ....
}

Post a Comment for "Must Declare The Scalar Variable @firstname"