Table Adapter connections

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sl1ver
    New Member
    • Mar 2009
    • 196

    Table Adapter connections

    Im fixing an application a guy wrote
    Now he wrote it pointing to an access database(the datagrid), now my boss wants me to be able to point to both access or sql at any one time.

    Now the table adapter refrences the access database. I want to be able to set that path everytime a user wants to log on.

    Anyone know how i can do that programatically ?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Code:
    string MyDbPath = string.empty; // global scope
    
    LoggedInSuccessfully()
    {// Called when someone successfullylogs in
         MyDbPath = "K:\serverDBs\thisone.sql";// or whatever the path is
    }

    Comment

    • Sl1ver
      New Member
      • Mar 2009
      • 196

      #3
      How will this change where the table adapter is looking to get information from?

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Originally posted by Sl1ver
        Im fixing an application a guy wrote
        Now he wrote it pointing to an access database(the datagrid), now my boss wants me to be able to point to both access or sql at any one time.

        Now the table adapter refrences the access database. I want to be able to set that path everytime a user wants to log on.

        Anyone know how i can do that programatically ?
        Originally posted by Sl1ver
        How will this change where the table adapter is looking to get information from?
        Well I certainly have no idea how your code is laid out. No clue how this other guy wrote his log in. No clue what variable names you guys are using.

        You asked how to set a path when someone logs in. I showed you a little code snippet of a method that sets a string variable when someone logs in.

        Ask a vague generic question with no code or context...
        Get a vague generic answer.

        Comment

        Working...