本文介绍了在设计模式下制作数据集,绑定源(ASP.Net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想知道为什么我们必须编写所有代码(如我下面的代码)才能在ASP.Net中创建数据集和表适配器.

Hi,
I wonder why we have to write all the code (like I have below) to make dataset and tableadapters in ASP.Net.

Dim conStr As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\dbTest.mdf;Integrated Security=True;User Instance=True"
    Dim sqlQry As String = "SELECT * FROM tblTest"
Dim dAdt As New SqlDataAdapter(sqlQry, conStr)
Dim dSet As New DataSet()
dAdt.Fill(dSet, "tblTest")



有没有像在winforms中一样的设计方法,只需添加绑定源,然后添加数据集和表适配器?

感谢



Is there any designing way like we do in winforms, just by adding binding source and then adding dataset and table adapter?

Thanks

推荐答案

GridView1.DataSource=dsl
GridView1.DataBind()


是的,您正在寻找从设计观点出发的东西,您可以做到. GridView具有一个智能标记(在DesingView中为>中的符号),单击该标记,选择数据源并按照说明进行操作.


Yes, you are looking for doing the stuff from design view, you can do that. GridView has a Smart Tag, ( > Symbol in DesingView ) Click on that, select data source and follow the instruction.


这篇关于在设计模式下制作数据集,绑定源(ASP.Net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 11:09