Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL sonnection question with typed dataset.
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

12 Posts

Posted - 05/04/2006 :  22:04:12  Show Profile  Reply with Quote
I have a question about the SQL connection.

I am using VS2005 and SQL2005.

I create a "Data Connection" using trusted connection when I set up a Typed Dataset.

So the connection string is auto-generated and store in the Solution Properties Settings


[global::System.Configuration.DefaultSettingValueAttribute("Data Source=SERVERNAME;Initial Catalog=MyApplication;Integrated Security=True;Application Name=\"APPLICTIONNAME\"")]

public string MyApplicationConnectionString {

get {

return ((string)(this["MyApplicationConnectionString"]));



I have a login screen which capture the username and password to make a connection string,


SqlConnection conn = new SqlConnection();

conn.ConnectionString = "data source=localhost;initial catalog=MyApplication" +

";User Id=" + strName + ";Password=" + strPassword +

";Application Name=MyApplication";


I want the retrieve of all data are using this 2nd connection string instead of MyApplicationConnectionString.

As you see I have two connection strings. I wonder at the run-time, what connectionstring will the typed dataset use? I assume it will be the "MyApplicationConnectionString", if so, how I can force is to use the second connectionstring(conn)?


Flowing Fount of Yak Knowledge

4110 Posts

Posted - 05/04/2006 :  22:07:54  Show Profile  Send jen a Yahoo! Message  Reply with Quote
you can check by verifying the status of the connection
not really familiar yet with vs2005

if it's connected, then you can close it
open the 2nd connection

keeping it simple...
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000