可以把这两个组件放在Application里面,在其他页面里读取这个Application。
但是把Connection放在Application里面并不能节省资源。
但是把Connection放在Application里面并不能节省资源。
解决方案 »
- 后台cs取数据判断,但要用javascript弹出让用户确认的对话框
- gridview里的linkbutton的OnClientClick传值问题
- 麻烦大家帮忙做两道题
- SqlDataAdapter和SqlDataReader如何一起使用
- #################################有关从内容页引用母版页控件的问题
- 安装Visual Studio.net2003这样的出错帮忙
- 本人业余项目开发ASP.NET+SQL server 2000!!各位兄弟有项目别忘了给我一份!!
- asp.net如何连接oracle数据集群双IP
- 微信公众平台接口在线调试说:验证失败,有谁知道啥原因吗?
- 在ASP.Net页面中如何调用COM+组件呀?
- 我的问题出在那里?急!
- image类问题
Dim cnstr As String = "Provider = SQLOLEDB.1;Password=mvb1234;Persist Security Info=True;User ID=sa;Initial Catalog=tfmsdb;Data Source=mvb"
Dim dc As OleDb.OleDbDataAdapter
Dim ds As New DataSet()
Dim dr As DataRow
Dim mytable As DataTable
cnn.ConnectionString = cnstr
cnn.Open()
dc = New OleDb.OleDbDataAdapter("select top 20 * from person", cnstr)
dc.Fill(ds, "person")
mytable = ds.Tables("person")
DataGrid1.DataSource = ds.Tables("person")
DataGrid1.DataBind()
DataGrid1.DataMember = mytable.TableName