Initialize dataset/adapters with ConnectionString

J

Jorge Gutierrez

I have a dataset with mutiple table adapter that they all connect to the
same SQL Server.
They use the connection string from web.config

Is it possible to initialize the dataset/table adapters with another
connection string without modifing the autogenerated code?

Thanks!
 
W

William Vaughn \(MVP\)

I suspect that the TableAdapter connection string is stored in the Settings
which can be accessed programmatically.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________
 
G

Gregory A. Beamer

I have a dataset with mutiple table adapter that they all connect to the
same SQL Server.
They use the connection string from web.config

Is it possible to initialize the dataset/table adapters with another
connection string without modifing the autogenerated code?


Get the connection object from the Table Adapter and change it. If I
remember correctly, that is all you have to do.

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top