在vb.net中为我的sql添加按钮编码 [英] add button coding in vb.net for my sql
本文介绍了在vb.net中为我的sql添加按钮编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过按下vb.net的按钮在mysql表中添加数据请告诉我该按钮的编码
解决方案
试试:
使用con作为新的MySqlConnection(strConnect)
con.Open()
使用com作为新的MySqlCommand(INSERT INTO myTable(myColumn1,myColumn2)VALUES(@ C1) ,@ C2),con)
com.Parameters.AddWithValue(@ C1,myValueForColumn1)
com.Parameters.AddWithValue(@ C2,myValueForColumn2)
com.ExecuteNonQuery( )
结束使用
结束使用
http://www.vbdotnetforums.com/database-general-discussion/28818-mysql-insert-command.html [ ^ ]
http://forums.mysql.com/read。 php?38,10757,14565 [ ^ ]
http://www.sourcecodester.com/visual-basic-net/how-add-update-delete-record-using-mysql.html [ ^ ]
http:/ /www.dreamincode.net/forums/topic/224893-update-mysql-using-vbnet/ [ ^ ]
(此行为ms访问但概念与mylsql服务器相同)
http://www.sourcecodester.com/visual-basic-net/how-addupdatedelete-record-using-ms-access-database.html [ ^ ]
i want to add data in mysql table by pressing the button of vb.net pls tell me the coding of that button
解决方案
Try:
Using con As New MySqlConnection(strConnect) con.Open() Using com As New MySqlCommand("INSERT INTO myTable (myColumn1, myColumn2) VALUES (@C1, @C2)", con) com.Parameters.AddWithValue("@C1", myValueForColumn1) com.Parameters.AddWithValue("@C2", myValueForColumn2) com.ExecuteNonQuery() End Using End Using
http://www.vbdotnetforums.com/database-general-discussion/28818-mysql-insert-command.html[^]
http://forums.mysql.com/read.php?38,10757,14565[^]
http://www.sourcecodester.com/visual-basic-net/how-add-update-delete-record-using-mysql.html[^]
http://www.dreamincode.net/forums/topic/224893-update-mysql-using-vbnet/[^]
(This line for ms access but concept is same as mylsql server )
http://www.sourcecodester.com/visual-basic-net/how-addupdatedelete-record-using-ms-access-database.html[^]
这篇关于在vb.net中为我的sql添加按钮编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文