Using SqlCommand , how to add multiple parameters to its object , insertion via winform in sql table
问题 I have ten textboxes in my winform, and i need to save the text typed in these textboxes into 10 columns of a sql database table. so, for this shall i write : INSERT INTO item (c1,c2,c3...,c10) values (@a,@b....@j) cmd.Parameters.Add("@a",SqlDbType.Varchar) cmd.Parameteres["@a"].Value=textbox1.Text; cmd.Parameters.Add("@b",SqlDbType.Varchar) cmd.Parameteres["@b"].Value=textbox2.Text;. . . . . cmd.Parameters.Add("@j",SqlDbType.Varchar) cmd.Parameteres["@j"].Value=textbox10.Text; OR ten