[英]How can I save my Textbox content in a database? Textbox is programmed in HTML and CSS
无论您希望在哪个事件中执行此事件,都可以使用它:
string con = //your connection string here
string yourTextValue = Passnummer.Text; //This will extract the text from your textbox and store it in a variable
using (string con = new SqlConnection()) {
con.Open();
var command =
new SqlCommand("INSERT INTO yourTable(columnname) VALUES (@textValue);", con);
command.Parameters.AddWithValue("@textValue", yourTextValue);
command.ExecuteNonQuery();
con.Close();
}
看这里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.