Results 1 to 7 of 7

Thread: simple ado.net question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166

    simple ado.net question

    Code:
    conauthors = new oledbconnection ("provider........."; DATA Source=c:\Authors.mdb)
    This is what i would use to set up a connection for a acces-db. I'd like to make an oledb-connection for my sql-server-db which is on a different computer in my network...

    what should i use for data source?
    never argue with an idiot, he will bring you down to his level and will beat you through experience

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You could benefit from using the SQL optimized code in the framework... SqlConnection , SQLCommand...etc.

    I always let the Server Explorer write the connection for me, and then cut and paste the code it writes and put it wherever I need it.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166
    thank you for answering.

    What do you mean by server explorer or where can i find it?

    I am trying it with a DSN now, looks like it works better...

    cu,
    never argue with an idiot, he will bring you down to his level and will beat you through experience

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You can find the Server Explorer from the View menu in the VS .Net IDE.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166
    i see, handy! i don't see anything i can copy and paste and then use for a connection string though...

    regards,
    never argue with an idiot, he will bring you down to his level and will beat you through experience

  6. #6
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You can connect to the database with the server explorer, once you have properly connected, right-click the db in the explorer, and copy the entire string out of the connectString property.

    You can also drag stored procedures onto your forms (when in Design mode), and it will automatically write the code for you.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166
    thanks a lot!
    never argue with an idiot, he will bring you down to his level and will beat you through experience

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