P
Peter
Guest
I looked thru the forums and couldnt find any answere to this.. or maybe im to tired to see it. Anyway, my question is how i make a connection to an SQL-server.
In earlier VB6 application i used this:
How do i do this in VB.NET?
Thanks!
Regards,
Peter
In earlier VB6 application i used this:
Code:
Public DataConn As New ADODB.Connection
Dim rsTemp As Recordset
DataConn.Provider = "SQLOLEDB;Data Source=SQLSERVERNAME;Initial Catalog=MYDB;User ID=sa;Password=thepassword"
DataConn.Open
Set rsTemp = DataConn.Execute("SELECT * FROM TABLE")
Do While Not rsTemp.EOF
Debug.Print rsTemp(1)
rsTemp.MoveNext
Loop
DataConn.Close
Set rsTemp = Nothing
How do i do this in VB.NET?
Thanks!
Regards,
Peter