Re: ADODB on dotnet.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr. X.

    #1

    Re: ADODB on dotnet.

    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.connectio n, and open it with a connectionStrin g.
    set a recordset by some pure sql : ado.recordSet rs =
    connection.Exec uteQuery( 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 :)


  • Michel Posseth  [MCP]

    #2
    Re: ADODB on dotnet.

    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.connectio n, and open it with a connectionStrin g.
    set a recordset by some pure sql : ado.recordSet rs =
    connection.Exec uteQuery( sql ...)
    do some rs.getNext until rs.eof.
    close rs and connection.
    the ADO.Net equivalant would be something like this

    Imports System.Data.Sql Client

    Public Class Form1

    Private Sub test()

    Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders"

    'standard : Data Source=myServer Address;Initial Catalog=myDataB ase;User
    Id=myUsername;P assword=myPassw ord;

    'Trusted : Data Source=myServer Address;Initial Catalog=myDataB ase;Integrated
    Security=SSPI;

    Using myConnection As New SqlConnection(" Data Source=myServer Address;Initial
    Catalog=myDataB ase;Integrated Security=SSPI;" )

    Dim myReader As SqlDataReader

    Using myCommand As New SqlCommand(mySe lectQuery, myConnection)

    myConnection.Op en()

    myReader = myCommand.Execu teReader()

    End Using

    ' Always call Read before accessing data.

    While myReader.Read()

    Debug.WriteLine ((myReader.GetI nt32(0) & ", " & myReader.GetStr ing(1)))

    End While

    ' always call Close when done reading.

    myReader.Close( )

    ' Close the connection when done with it.

    myConnection.Cl ose()

    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




    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]







    "Mr. X." <no_spam_please @nospam_please. comschreef in bericht
    news:%234YUK6kL JHA.5232@TK2MSF TNGP05.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.connectio n, and open it with a connectionStrin g.
    set a recordset by some pure sql : ado.recordSet rs =
    connection.Exec uteQuery( 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 :)
    >

    Comment

    Working...