Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where did my password go?
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01302910
Message ID:
01302948
Views:
7
This message has been marked as the solution to the initial question of the thread.
see http://thedotnet.com/nntp/444763/showpost.aspx

you need to add Persist Security Info = True to your connection string


>Consider the following code:
>
>SqlConnection sqlConnection = new SqlConnection(@"Data Source=123.123.123.123\Alliance;Initial Catalog=MyApp;Integrated Security=False;User ID=Einar;Password=Einar;Connect Timeout=15");
>
>MessageBox.Show("sqlConnection.ConnectionString"+sqlConnection.ConnectionString, "BEFORE");
>sqlConnection.Open();
>sqlConnection.Close();
>MessageBox.Show("sqlConnection.ConnectionString" + sqlConnection.ConnectionString, "AFTER");
>
>
>Code is simple enough. I create a connection, I open it and then I close it.
>In the first messagebox (the BEFORE msgbox) the connection string is exactly what I expect it to be, i.e., exactly what I set it to be in the line before. In the second messagebox (the AFTER msgbox) the connection string is exactly what I expect it to be EXCEPT "Password=Einar;" is missing!
>
>Is this a bug or a feature? If it is a feature how does this feature help me?
>
>Thanks,
>Einar
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform