Why can not add "OleDb.OleDbConnection", no solution

sxr520wz

New member
Joined
Jul 29, 2007
Messages
1
Location
china
Programming Experience
1-3
1.Public sr As StreamReader = New StreamReader("ServerName.txt")
Public txt As String = RTrim(sr.ReadLine())
Public my_connec As New OleDb.OleDbConnection("Provider=SQLOLEDB;User ID=sa;Password=;database=gas_meter;
server='"&txt&"'")


2.Public sr As StreamReader = New StreamReader("ServerName.txt")
Public txt As String = RTrim(sr.ReadLine())
Public constr As String = "User ID=sa;Password=;database=gas_meter;server='" & txt & "'"

The first group can't link databases , the second group is right .
why????
 
This is probably because you connecting to the wrong provider what type of database is this?

Since you are using .NET 2.0 you should be able to walk through the database connection process and easily create a connection string which be included in the configurations for the project.
 
Back
Top