Imports System.Data.SqlClient
Imports System.Data
Dim sqlconn As New SqlConnection
Dim sqlcomm As New SqlCommand
Dim connStr As String
'应加上数据库服务器名,数据库名,数据库密码
connStr = "Server=192.168.10.89;Database=dvr-data;user Id=sa;Password="
sqlconn.ConnectionString = connStr
'应加上数据库服务器测试,数据库名及数据库密码测试
sqlconn.Open()
sqlcomm.Connection = sqlconn
Dim dataRd As SqlDataReader
= CommandType.Text
Dim commStr As String
commStr = "SELECT DVR_Data.* FROM DVR_Data"
= commStr
sqlconn.Close()
sqlconn.Open()
dataRd = sqlcomm.ExecuteReader