Last post Aug 25, 2012 05:12 AM by Decker Dong - MSFT
Aug 23, 2012 10:38 AM|faroukfisher|LINK
i want to add a connection to my database in my code C# , but the visual studio did'nt detect my data source
SqlDataSource dss = new SqlDataSource();
dss.ID = "sqlgl";
dss.ConnectionString = ";data source=W2K8\SQLEXPRESS;initial catalog=YesRems;integrated security=True;";
dss.SelectCommand = "SELECT [Code],[PKey] FROM [AdmRole]";
it didn't detect the "\" caracter
Aug 23, 2012 11:20 AM|syed.iddi|LINK
= "data source=W2K8\SQLEXPRESS;initial catalog=YesRems;integrated security=True;";
Aug 23, 2012 02:52 PM|Damn Code|LINK
In your ConnectionString there is Error Syntax. please remove ';' symbol that placed in First and End ConnectionString. Try to replace your ConnectionString to one of these ConnectionString
Format. Hope get help.
Aug 25, 2012 05:12 AM|Decker Dong - MSFT|LINK
but the visual studio did'nt detect my data source
I suggest you trying to open Vs and then turn to "View"=>"Server Explorer" and the create a remote connection to the sepcific database and then copy the connection string.