sql数据连接问题
例子:
1。在客户方(Html)代码中加入:
2。在服务器方(Server)引用:
Dim cn As New OleDb。OleDbConnection()
cn。 ConnectionString = "Provider=SQLOLEDB。1;Persist Security Info=True;User ID=sa;Password=;Initial Catalog=MyDataBase;Data Source= "
cn。 Open()
Dim strSql As String, i As Integer, j As Integer
strSql = "Select * Fr...全部
例子:
1。在客户方(Html)代码中加入:
2。在服务器方(Server)引用:
Dim cn As New OleDb。OleDbConnection()
cn。
ConnectionString = "Provider=SQLOLEDB。1;Persist Security Info=True;User ID=sa;Password=;Initial Catalog=MyDataBase;Data Source= "
cn。
Open()
Dim strSql As String, i As Integer, j As Integer
strSql = "Select * From tTable "
Dim rs As OleDb。
OleDbDataReader
Dim cmd As New OleDb。OleDbCommand(strSql, cn)
rs = cmd。ExecuteReader
While rs。
Read() = True
If IsDBNull(rs("FieldName")) Then
txtName。Text = ""
Else
txtName。
Text = rs("FieldName")
End If
。。。
End While
rs。Close()
cn。
Close()
rs = Nothing
cn = Nothing。收起