Monu Zira我们如何使用数据表插入多行 [英] Monu Zira how can we use datatable for insert multiple row

查看:141
本文介绍了Monu Zira我们如何使用数据表插入多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生/妈妈,我想从您这里得到帮助.我正在asp.net c#和sql server中工作.假设我在数据库中有3列,并且我想在单击时在数据库中插入多行.如果我有5个文本框,则将插入5行.
请帮助我将等待您的回答

Hello sir/mam i want to help from you.i am working in asp.net c# and sql server. Suppose I have 3 columns in database and i want to insert multiple row in database on click. If i have 5 textbox mean 5 row will be insert.
Please help i will wait your answer

推荐答案

如果我正确理解了这个问题,您会SqlParameters [执行 [版本4,为重复的语句做准备 [^ ]
If I understand the question correctly, you would Prepare[^] the statement and define the SqlParameters[^]. Then for each text box you would set the value for the parameter and Execute[^] the query.

So the basic idea is similar to a loop. For an example, have a look at Version 4, use prepare for repeated statements[^]


这篇关于Monu Zira我们如何使用数据表插入多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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