I’m trying to save multiple textbox values to database into multiple rows. My form is as follows
textbox1 texbox 2 —- row 1 in database
textbox3 textbox 4 ——row 2 in database
edit: I should clarify that textbox 1 and texbox 3 are in the same column and using the same param1
Ive been to save single values before using
cnn.Open();
SqlTransaction tran = cnn.BeginTransaction();
cmd.Connection = cnn;
cmd.Transaction = tran;
cmd.CommandText = "stored procedure";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = cnn;
SqlParameter p1 = new SqlParameter("@param1", SqlDbType.Int);
SqlParameter p2 = new SqlParameter("@param2", SqlDbType.Int);
cmd.Parameters.Add(p1);
cmd.Parameters.Add(p2);
If I understand properly, try it