Connecting Tech Pros Worldwide Forums | Help | Site Map

Table Adapter connections

Sl1ver's Avatar
Member
 
Join Date: Mar 2009
Location: Cape Town, South Africa
Posts: 104
#1: Aug 19 '09
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's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,784
#2: Aug 19 '09

re: Table Adapter connections


Expand|Select|Wrap|Line Numbers
  1. string MyDbPath = string.empty; // global scope
  2.  
  3. LoggedInSuccessfully()
  4. {// Called when someone successfullylogs in
  5.      MyDbPath = "K:\serverDBs\thisone.sql";// or whatever the path is
  6. }
Sl1ver's Avatar
Member
 
Join Date: Mar 2009
Location: Cape Town, South Africa
Posts: 104
#3: Aug 19 '09

re: Table Adapter connections


How will this change where the table adapter is looking to get information from?
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,784
#4: Aug 19 '09

re: Table Adapter connections


Quote:

Originally Posted by Sl1ver View Post

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?

Quote:

Originally Posted by Sl1ver View Post

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.
Reply