N
nj_herry
Unregistered / Unconfirmed
GUEST, unregistred user!
请教一个简单问题,为何老提示:未定义类型SqlConnection,谢谢,在线等待
原码如下:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQL" %>
<html>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim DS As DataSet
Dim MyConnection As SQLConnection
Dim MyCommand As SQLDataSetCommand
'同数据库进行连接,采用sql server数据库
MyConnection = New SQLConnection("server='ZHONG';uid=sa;pwd=;database=ny")
'执行SQL操作
MyCommand = New SQLDataSetCommand("select * from userlist",MyConnection)
DS = New DataSet()
MyCommand.FillDataSet(ds, "userlist")
MyDataGrid.DataSource=ds.Tables("userlist").DefaultView
MyDataGrid.DataBind()
End Sub
</script>
<center>
原码如下:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQL" %>
<html>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim DS As DataSet
Dim MyConnection As SQLConnection
Dim MyCommand As SQLDataSetCommand
'同数据库进行连接,采用sql server数据库
MyConnection = New SQLConnection("server='ZHONG';uid=sa;pwd=;database=ny")
'执行SQL操作
MyCommand = New SQLDataSetCommand("select * from userlist",MyConnection)
DS = New DataSet()
MyCommand.FillDataSet(ds, "userlist")
MyDataGrid.DataSource=ds.Tables("userlist").DefaultView
MyDataGrid.DataBind()
End Sub
</script>
<center>