单击多个按钮即可从文本框中保存 [英] Save from textbox with multiple button click
本文介绍了单击多个按钮即可从文本框中保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我有7个文本框,每次单击关闭按钮我想将数据保存到数据库表中的单行,这样我怎么能做这样的事情
我尝试了什么:
Hello i have 7 text boxes and on each click off the button i want to save the data to single row in data base table so how can i do something like this
What I have tried:
private void button1_Click(object sender, EventArgs e)
{
CON.Open();
string SQLQUERY = "INSERT INTO table1 (name1,last1,first1,second1,top1,bottom1,last1)VALUES(@text1, @text2, @text3, @text4, @text5, @text6, @text7)";
next
string SQLQUERY = "INSERT INTO table1 (name2,last2,first2,second2,top2,bottom2,last2)VALUES(@text1, @text2, @text3, @text4, @text5, @text6, @text7)";
推荐答案
试试这个
try this
string SQLQUERY = "INSERT INTO table1 (name1,last1,first1,second1,top1,bottom1,last1, name2,last2,first2,second2,top2,bottom2,last2)VALUES(@text1, @text2, @text3, @text4, @text5, @text6, @text7, @text1, @text2, @text3, @text4, @text5, @text6, @text7)";
这篇关于单击多个按钮即可从文本框中保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文