Hello Mr. X
ADO.Net is the bether choice for all .Net languages unless you have a valid
reasson to stick with ADO classic
i now for a fact that some programmers still use ADO classic just because
they use the ADOX features in there programs
however the same can be acomplished with ADO.Net and some DDL SQL .
here is a good ADO.Net reference
http://msdn.microsoft.com/nl-nl/data...22(en-us).aspx
What classic thing to do is :
using adodb.connection, and open it with a connectionString.
set a recordset by some pure sql : ado.recordSet rs =
connection.ExecuteQuery( sql ...)
do some rs.getNext until rs.eof.
close rs and connection.
the ADO.Net equivalant would be something like this
Imports System.Data.SqlClient
Public Class Form1
Private Sub test()
Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders"
'standard : Data Source=myServerAddress;Initial Catalog=myDataBase;User
Id=myUsername;Password=myPassword;
'Trusted : Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated
Security=SSPI;
Using myConnection As New SqlConnection("Data Source=myServerAddress;Initial
Catalog=myDataBase;Integrated Security=SSPI;")
Dim myReader As SqlDataReader
Using myCommand As New SqlCommand(mySelectQuery, myConnection)
myConnection.Open()
myReader = myCommand.ExecuteReader()
End Using
' Always call Read before accessing data.
While myReader.Read()
Debug.WriteLine((myReader.GetInt32(0) & ", " & myReader.GetString(1)))
End While
' always call Close when done reading.
myReader.Close()
' Close the connection when done with it.
myConnection.Close()
End Using
End Sub
End Class
What may be difference between ADO.NET & ADO ?
What are the stages of ADO.NET ?
http://msdn.microsoft.com/en-us/libr...4k(VS.80).aspx http://en.wikipedia.org/wiki/ADO_vs_ADO.NET
I recomend you to read in on the subject it is not so hard , buy yourself
some good MS PRESS books
regards
Michel Posseth [MCP]
http://www.vbdotnetcoder.com
"Mr. X." <no_spam_please@nospam_please.comschreef in bericht
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hello.
If ADO.NET is better choice for modern programming,
so I shall use it.
There is also application-box - is it related to ADO.NET.
What classic thing to do is :
using adodb.connection, and open it with a connectionString.
set a recordset by some pure sql : ado.recordSet rs =
connection.ExecuteQuery( sql ...)
do some rs.getNext until rs.eof.
close rs and connection.
What may be difference between ADO.NET & ADO ?
What are the stages of ADO.NET ?
No need much answer,
because I just got confused from VS 2008, and need some practice on it.
Problem has been solved since I add reference to ADO.
Thanks :)