PC Review


Reply
Thread Tools Rate Thread

Connection String Issues

 
 
Sankalp
Guest
Posts: n/a
 
      17th Jan 2007
Currently I am developing a advanced VB 2005 application which
Display's/ Updates / (Creates New ) data in the database. For this
purpose I am using databound controls, i.e. all my datagrids, textboxes
etc.. are directly linked to the database.

Initially I was using My.Settings.Con ,( where Con being the
connection string in the app.config file) to reference the connection
string used by these table adapters.


Now the problem is that, due to a sudden change is requirement, I need
to add in multiple connection strings ( i.e give users the option to
connect to different databases during application start up ) . Since
all these databases have the same table name and underlying structure I
don't need to change my program ( Logic ) at all.

I need to give the users to ability to select the database at
application startup( First Time , after installation ) and then give
them the ability to change the database during runtime,\ AND after the
user finishes working with the application( i.e Closes the application)
and then returns, the application should automatically point to the
last database the user worked with.


I am using Visual Studio 2005 , .NET 2.0



I am not sure how to do this. Any help in this regard will be
gratefully appreciated.

 
Reply With Quote
 
 
 
 
rowe_newsgroups
Guest
Posts: n/a
 
      18th Jan 2007
This doesn't seem all that complicated. Presuming you know what the
connection string will be for each db, then all you need to do is match
the Database name to the connection string. If you really wanted to, a
select case could handle this, or am I missing something?

Thanks,

Seth Rowe


Sankalp wrote:
> Currently I am developing a advanced VB 2005 application which
> Display's/ Updates / (Creates New ) data in the database. For this
> purpose I am using databound controls, i.e. all my datagrids, textboxes
> etc.. are directly linked to the database.
>
> Initially I was using My.Settings.Con ,( where Con being the
> connection string in the app.config file) to reference the connection
> string used by these table adapters.
>
>
> Now the problem is that, due to a sudden change is requirement, I need
> to add in multiple connection strings ( i.e give users the option to
> connect to different databases during application start up ) . Since
> all these databases have the same table name and underlying structure I
> don't need to change my program ( Logic ) at all.
>
> I need to give the users to ability to select the database at
> application startup( First Time , after installation ) and then give
> them the ability to change the database during runtime,\ AND after the
> user finishes working with the application( i.e Closes the application)
> and then returns, the application should automatically point to the
> last database the user worked with.
>
>
> I am using Visual Studio 2005 , .NET 2.0
>
>
>
> I am not sure how to do this. Any help in this regard will be
> gratefully appreciated.


 
Reply With Quote
 
 
 
 
Sankalp
Guest
Posts: n/a
 
      18th Jan 2007
Yes I have the connection strings with me before hand, but how can I
match the database name to the connection string.

Some sort of code would be helpful.


Thankyou


rowe_newsgroups wrote:
> This doesn't seem all that complicated. Presuming you know what the
> connection string will be for each db, then all you need to do is match
> the Database name to the connection string. If you really wanted to, a
> select case could handle this, or am I missing something?
>
> Thanks,
>
> Seth Rowe
>
>
> Sankalp wrote:
> > Currently I am developing a advanced VB 2005 application which
> > Display's/ Updates / (Creates New ) data in the database. For this
> > purpose I am using databound controls, i.e. all my datagrids, textboxes
> > etc.. are directly linked to the database.
> >
> > Initially I was using My.Settings.Con ,( where Con being the
> > connection string in the app.config file) to reference the connection
> > string used by these table adapters.
> >
> >
> > Now the problem is that, due to a sudden change is requirement, I need
> > to add in multiple connection strings ( i.e give users the option to
> > connect to different databases during application start up ) . Since
> > all these databases have the same table name and underlying structure I
> > don't need to change my program ( Logic ) at all.
> >
> > I need to give the users to ability to select the database at
> > application startup( First Time , after installation ) and then give
> > them the ability to change the database during runtime,\ AND after the
> > user finishes working with the application( i.e Closes the application)
> > and then returns, the application should automatically point to the
> > last database the user worked with.
> >
> >
> > I am using Visual Studio 2005 , .NET 2.0
> >
> >
> >
> > I am not sure how to do this. Any help in this regard will be
> > gratefully appreciated.


 
Reply With Quote
 
rowe_newsgroups
Guest
Posts: n/a
 
      18th Jan 2007
> Some sort of code would be helpful.

No problem - First off, how would you like the user to select the
database to use? i.e. a combobox, listbox, etc...

Thanks,

Seth Rowe


Sankalp wrote:
> Yes I have the connection strings with me before hand, but how can I
> match the database name to the connection string.
>
> Some sort of code would be helpful.
>
>
> Thankyou
>
>
> rowe_newsgroups wrote:
> > This doesn't seem all that complicated. Presuming you know what the
> > connection string will be for each db, then all you need to do is match
> > the Database name to the connection string. If you really wanted to, a
> > select case could handle this, or am I missing something?
> >
> > Thanks,
> >
> > Seth Rowe
> >
> >
> > Sankalp wrote:
> > > Currently I am developing a advanced VB 2005 application which
> > > Display's/ Updates / (Creates New ) data in the database. For this
> > > purpose I am using databound controls, i.e. all my datagrids, textboxes
> > > etc.. are directly linked to the database.
> > >
> > > Initially I was using My.Settings.Con ,( where Con being the
> > > connection string in the app.config file) to reference the connection
> > > string used by these table adapters.
> > >
> > >
> > > Now the problem is that, due to a sudden change is requirement, I need
> > > to add in multiple connection strings ( i.e give users the option to
> > > connect to different databases during application start up ) . Since
> > > all these databases have the same table name and underlying structure I
> > > don't need to change my program ( Logic ) at all.
> > >
> > > I need to give the users to ability to select the database at
> > > application startup( First Time , after installation ) and then give
> > > them the ability to change the database during runtime,\ AND after the
> > > user finishes working with the application( i.e Closes the application)
> > > and then returns, the application should automatically point to the
> > > last database the user worked with.
> > >
> > >
> > > I am using Visual Studio 2005 , .NET 2.0
> > >
> > >
> > >
> > > I am not sure how to do this. Any help in this regard will be
> > > gratefully appreciated.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
StringBuilder.replace(string,string) performance issues Patrick Flanagan Microsoft Dot NET Compact Framework 1 12th Jan 2010 12:42 PM
ISSUES ISSUES ISSUES! =?Utf-8?B?Sm9obnNhYnU=?= Windows Vista Installation 7 2nd Mar 2007 06:19 AM
how to make two references to one string that stay refered to the same string reguardless of the changing value in the string? Daniel Microsoft Dot NET 7 12th Nov 2004 10:08 AM
Re: Converting a string to a string that contains the ASCII values of each letter in the origional string Jon Skeet Microsoft C# .NET 0 31st Jul 2003 08:38 PM
Re: Converting a string to a string that contains the ASCII values of each letter in the origional string Frank Oquendo Microsoft C# .NET 0 31st Jul 2003 08:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:46 AM.