Hello .
I am stucked with the following problem and hope you can help me :
- My ASP.NET 2.0 application has one master database .
- This master database has a Databases table with list of children
databases .
- All children databases have the same schema ( only the data is
different ) .
My application connects to the Master database first (
connection String of this database should be read from the C:\WINDOWS
\XXX.INI file).
Login web page will present drop-down list of sub-databases ( which
will be
retrieved from the Master database ) and then will connect to
specified sub-database and will display data
from this database in a GridView .
I would like to be able to bind this GridView to the Data Source
Objects , to edit all columns during design time , and to set the
connection string of corresponding table adapter programmatically
during run-time .
How can I do this ?
I found several references to the connection string ( for example ,
via appSettings) , but I got an error message that this is read only
parameter .
Please advice .
Thanks in advance for your help ,
Orit Chanukov .Keep it in a session variable.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Orit" <oritc123@.gmail.com> wrote in message
news:1183138531.120152.59480@.a26g2000pre.googlegroups.com...
> Hello .
> I am stucked with the following problem and hope you can help me :
> - My ASP.NET 2.0 application has one master database .
> - This master database has a Databases table with list of children
> databases .
> - All children databases have the same schema ( only the data is
> different ) .
> My application connects to the Master database first (
> connection String of this database should be read from the C:\WINDOWS
> \XXX.INI file).
> Login web page will present drop-down list of sub-databases ( which
> will be
> retrieved from the Master database ) and then will connect to
> specified sub-database and will display data
> from this database in a GridView .
> I would like to be able to bind this GridView to the Data Source
> Objects , to edit all columns during design time , and to set the
> connection string of corresponding table adapter programmatically
> during run-time .
> How can I do this ?
> I found several references to the connection string ( for example ,
> via appSettings) , but I got an error message that this is read only
> parameter .
> Please advice .
> Thanks in advance for your help ,
> Orit Chanukov .
>
Thursday, March 29, 2012
Set connection string of table adapter dynamically
Labels:
adapter,
application,
asp,
connection,
database,
dynamically,
following,
master,
net,
string,
stucked,
table
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment