对 SQLDataSource 中的每条记录执行操作
我最近提交了很多问题 - 但这是一个很棒的信息库。如您所见,我是一个 .NET 新手,因此如果我缺少基础知识或信息,请告诉我,我会尽力填补空白。
我使用 ASP.NET/VB.NET 通过 SQL 2005 创建这个。我有一个项目,我想从表中获取一组记录,然后通过 API 发送每条记录,获取结果并写回结果到一个表,然后移动到下一个。
最初,我的想法是创建一个 SQLDataSource 来获取所有记录,然后在按钮上执行操作以执行发送每条记录的操作。
有没有办法可以从 SQLDataSource 调用记录集并执行循环?我正在考虑类似于经典 ASP/VBScript 中的内容,您将打开一个记录集,执行一个操作,然后循环直到 RS 为 EoF。
感谢您的帮助!
I've submitted a bunch of questions as of late - but this has been a great repository of information. I'm a .NET nub, as you can see, so if I'm missing basics or information please let me know and I'll try and fill in the gaps.
I'm using ASP.NET/VB.NET to create this with SQL 2005. I have a project where I'd like to take a set of records from a table, then send each one through an API, get a result and writeback the result to a table, then move to the next.
Initially, my thought was create a SQLDataSource that grabs all the records, then perform the action on a button to do the action of sending through each record.
Is there a way I can call the recordset from SQLDataSource and perform a loop? I'm thinking something like in Classic ASP/VBScript where you would open a RecordSet, do an action, then Loop until the RS was EoF.
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能希望将结果放入数据集中。获得结果后,您可以循环返回的行
您也可以使用 sqlDataReader
You can may want to put your results in a dataset. After getting the results, you can loop through the returned rows
You could also use a sqlDataReader