如何使用vb.net和访问插入多个记录 [英] how to insert multiple records using vb.net and access

查看:86
本文介绍了如何使用vb.net和访问插入多个记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我创建这个项目我是vb.net的新用户

请给我这个项目的源代码

vb.net并访问我有一个form - (名称,地址,年龄,联系号)12行3个文本框,(每行4个txtbox)4x3,将由用户填写并按提交按钮,所有4个记录将插入到数据库中。可能吗?请帮我说明怎么做。

谢谢

please please help me to create this project i am new in vb.net
please give me source code for this project
vb.net and access i have a form - (Name,Address, Age ,Contact no) 12 textbox in 3 rows, (4 txtbox in each row) 4x3, which will be filled by the user and press the Submit button and all the 4 records will be inserted into Database. Is it possible? please assist me that how to do this.
thanks

推荐答案

你需要在提交按钮上写一个查询。



如果你想保存新记录,那么你需要使用inster查询,如果你需要更新旧记录,那么你需要使用更新查询。这里是您可以用作参考的示例查询



插入查询= INSERT INTO USER_INFO(名称,地址,年龄,Contact_no)值('& Textbox1。文字&',''& Textbox2.Text&','& Textbox3.Text&','& Textbox4.Text&')



更新查询= UPDATE USER_INFO SET Name ='& Textbox1.Text&',Address ='& Textbox2.Text&',Age ='& Textbox3。文字&',Contact_no ='& Textbox4.Text&'WHERE(PrimaryKey =pk)



下载使用此链接进行学习< br $> b $ b

插入,更新,删除&使用VB.NET 2005在MS Access 2003中搜索值 [ ^ ]
you need to write a query for on your submit button.

if you want to save new record then you need to use inster query and if you need to update old record then you need to use update query. here are is the sample query you can use for reference

Insert Query = INSERT INTO USER_INFO (Name, Addres, Age,Contact_no) Values ('" & Textbox1.Text & "', '" & Textbox2.Text & "', '" & Textbox3.Text & "', '" & Textbox4.Text & "')

Update Query = UPDATE USER_INFO SET Name = ' " & Textbox1.Text & "', Address = ' " & Textbox2.Text & "', Age = ' " & Textbox3.Text & "', Contact_no = ' " & Textbox4.Text & "' WHERE (PrimaryKey = "pk")

download use this link for study

Insert, Update, Delete & Search Values in MS Access 2003 with VB.NET 2005[^]


这篇关于如何使用vb.net和访问插入多个记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆