see
http://thedotnet.com/nntp/444763/showpost.aspxyou 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