我使用以下代码将 TextBox 值保存到数据库中。但是,当我插入该值时,它将保存在新行中。如何将其保存到同一行?
private void button1_Click(object sender, EventArgs e)
{
string pass = textBox1.Text;
sql = new SqlConnection(@"Data Source=PC-PC\PC;Initial Catalog=P3;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = sql;
cmd.CommandText = ("Insert [MyTable] ([MyColumn]) Values (@pass)");
cmd.Parameters.AddWithValue("@pass", pass);
sql.Open();
cmd.ExecuteNonQuery();
sql.Close();
}