在ASP.NET中使用类型化数据集 [英] Use of Typed dataset in asp.net

查看:67
本文介绍了在ASP.NET中使用类型化数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用Add>>>添加了一个类型化的DataSet. DataSet并将其配置为与我的SQLDatabase连接.此外,它还创建了Delete,UpDate,Select等命令.

在这个阶段,在winform formload事件中,我总是可以找到类似
的陈述 taTest.fill(dsTest.tblData),所以我可以使用dsTest.tblData读取,写入数据.
但是我在ASP.Net中找不到类似的东西.
我的问题是此DataSet的用途是什么,如何像在winforms中一样使用它.

例如,如果需要

msgbox(dsTest.tblData.rows.count)
它可以在winforms中工作,但不能在asp.net中工作

请帮忙.
谢谢

Hi,
I have added a typed DataSet using Add>>> DataSet and configured it to connect with my SQLDatabase. Also, it has created Delete, UpDate, Select etc. commands.

At this stage, in winform formload event, I could always find a statment something like
taTest.fill(dsTest.tblData) so I could use dsTest.tblData for reading, writing my data.
But I donot find anything like this in ASP.Net.
My question is what is the use of this DataSet and how can I use it like we do in winforms.

For example if need

msgbox (dsTest.tblData.rows.count)
it works in winforms but not in asp.net

Please help.
Thanks

推荐答案

数据集在winform n asp.net中是相同的.但是在asp.net消息框中不可用,您可以在asp.net中获取行数,如下所示
ds.Tables [0] .Rows.Count
data set are same in winform n asp.net. but in asp.net messagebox is not available you can get the rowcount in asp.net as below
ds.Tables[0].Rows.Count


数据集和数据表在WinForms和ASP.Net中的作用相同.

您面临的区别是用户界面层是不同的.与其尝试使用消息框,不如将计数放在页面的某个字段中.

在这里可以找到一些教程:
The dataset and the datatable act equally in WinForms and ASP.Net.

The difference you''re facing is that the user interface layer is different. Instead of trying to use message box, put the count to a field in your page.

Here''s one place you can find some tutorials: http://blogs.msdn.com/b/publicsector/archive/2007/06/29/online-asp-net-in-c-tutorial.aspx[^]



ds-表示您的数据集名称.
像yourdatasetname.Tables [0] .Rows.Count
一样
检查
hey hi
ds- means your dataset name.
take it like yourdatasetname.Tables[0].Rows.Count

check it


这篇关于在ASP.NET中使用类型化数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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