使用LINQ进行多行插入 [英] Multiple row insert using LINQ

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

问题描述

< root>
< value fname ="Thasthakir" lname ="raja" emp_no ="625" age ="23"/>
< value fname ="Mohamed" lname ="fayaz" emp_no ="626" age ="23"/>
< value fname ="Mohamed" lname ="Meeran" emp_no ="627" age ="10"/>
</root>

我可以使用linq ...将所有三行值插入表中吗?

在我的代码中,它获取了第一行值并被插入,但是没有插入两行值...

请给我建议一些想法!!!!!!!!!!!!



看看这个: ^ ]

或这样:
http://msdn.microsoft.com/en-us/library/ms188365.aspx [ ^ ]

希望对您有帮助


<root>
<value fname="Thasthakir" lname="raja" emp_no="625" age="23" />
<value fname="Mohamed" lname="fayaz" emp_no="626" age="23" />
<value fname="Mohamed" lname="Meeran" emp_no="627" age="10" />
</root>

can i insert all three rows of values into table using linq...

In my code its getting the first row of values and its get inserted ,but the 2 rows of values are not getting inserted...

pls suggest me some ideas!!!

解决方案

Hi,

Take a look at this: http://stackoverflow.com/questions/2624713/in-tsql-sql-server-how-do-i-insert-multiple-rows-without-repeating-the-inser[^]

or this:
http://msdn.microsoft.com/en-us/library/ms188365.aspx[^]

Hope it helps


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

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