这个SQL语句怎么写? 简单的想,你可以先用数据变量接收text中的数据啊。例如: int DataID; DataID = Convert.ToInt32(textBox1.Text); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 也可以绑定到DataSet中,直接返回到数据库中 如果使用数据作数据类型与长度的检验的话,不需要这么复杂,直接写sql = "INSERT INTO myTable( myId, myName, myAddress, myBalance ) VALUES( " + TextBox1.Text + "," + "'" + TextBox2.Text + "'," + "'" + TextBox3.Text + "'," + "'" + TextBox4.Text + "'" + ")"如果需要程序作检验的话,现将个text作相应的检查,然后在执行上面的语句。 再vb下我都是这么做的,c#还没试sql = "INSERT INTO myTable( myId, myName, myAddress, myBalance ) VALUES( " + int(val(TextBox1.Text)) + "," + "'" + TextBox2.Text + "'," + "'" + TextBox3.Text + "'," + + dbl(TextBox4.Text) + "'" + ")" 如你确认已校验过,直接这样写就可以了!不然的话,你应先校验符合格式!保险的办法是先把text转换成目标类型,在用ToString()方法。sql = "INSERT INTO myTable(myId, myName, myAddress, myBalance) VALUES(" + textBox1.text + ","+ "'" + textBox2.text + "', "+ "'" + textBox3.text + "', "+ " " + textBox3.text + ", "+ ")"; C++怎么样调用C#写的DLL 网上找的一段JAVA代码,求高手转成C# 请教下VS2010制作安装包的问题 qq空间游戏(非仙勿扰)外挂架构设计,欢乐讨论. 求助在公网上的即时通讯软件实现 在net/c#中,fastreport如何绑定手动生成的DataSet ado.net提供的连接数据库的方式选择哪个更合适? 窗体传参 关于数据库的问题? C#必败(之一)!!!!!!!!!!! 不拖拉控件而直接写代码怎么显示不了控件呢? 请教各位:c#默认继承级别为什么这么奇怪
sql = "INSERT INTO myTable( myId, myName, myAddress, myBalance ) VALUES( " + TextBox1.Text + "," +
"'" + TextBox2.Text + "'," +
"'" + TextBox3.Text + "'," +
"'" + TextBox4.Text + "'" +
")"
如果需要程序作检验的话,现将个text作相应的检查,然后在执行上面的语句。
sql = "INSERT INTO myTable( myId, myName, myAddress, myBalance ) VALUES( " + int(val(TextBox1.Text)) + "," +
"'" + TextBox2.Text + "'," +
"'" + TextBox3.Text + "'," +
+ dbl(TextBox4.Text) + "'" +
")"
+ textBox1.text + ","
+ "'" + textBox2.text + "', "
+ "'" + textBox3.text + "', "
+ " " + textBox3.text + ", "
+ ")";