Results 1 to 3 of 3

Thread: How do I get data from my connection?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    How do I get data from my connection?

    Ok, I have my connection string...

    Dim oOleDbConnection As OleDb.OleDbConnection
    Dim sConnString As String = _
    "Provider=sqloledb;" & _
    "Data Source=Blah;" & _
    "Initial Catalog=Blah;" & _
    "User Id=Titus;" & _
    "Password=Blah"
    oOleDbConnection = New OleDb.OleDbConnection(sConnString)
    oOleDbConnection.Open()

    In VB 6, I would do this to get the data from this string...

    Dim rs As New ADODB.Recordset

    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenDynamic
    rs.ActiveConnection = oOleDbConnection
    rs.LockType = adLockOptimistic

    rs.open "Select * from Blah Where Blah = Blah"

    How would I do this very same thing in .Net?

    Please be very specific because I know very little about .Net.

    Thank you.
    David Wilhelm

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Try the Data Access Overview tutorial at this site:
    http://samples.gotdotnet.com/quickstart/winforms/

  3. #3
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    Dim ds As New Dataset
    Dim da as New Oledb.OledbDataadapter("SELECT * FROM .....", oOleDbConnection)
    da.Fill(ds)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width