hiii friends.
i am using following code and it shows error near bold
SqlConnection cn = new SqlConnection(".\SQL;User Id=sa;Password=pass@123;Initial Catalog=test");
help me..its urgent
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj PandeyPosted Jun 17, 2013, 9:35 AM
SqlConnection cn = new SqlConnection("Data Source=your server name;User Id=sa;Password=pass@123;Initial Catalog=test")
Amit ChoudharyPosted Jun 17, 2013, 1:27 PM
RIM SinghPosted Jun 17, 2013, 9:47 AM
Error was "@" and also in connection string..i am using now..
SqlConnection cn = new SqlConnection(@"Data Source=.\sqlexpress;User Id=sa;Password=pass@123;Initial Catalog=test");
it works
thnx
Pankaj PandeyPosted Jun 17, 2013, 9:42 AM
SqlConnection cn = new SqlConnection(@".\SQL;User Id=sa;Password=pass@123;Initial Catalog=test");
i hope it will work, because connection string is ok,
if not then check your sql server setting.
open sql server, put .\SQL in server name, select window authentication and press ok, if it connect then it means connection string is ok...other wise you entered wrong server name.
mark as answered if helpful
Riyaz AkhtarPosted Jun 17, 2013, 9:41 AM
SqlConnection cn = new SqlConnection("Data Source=.\sqlexpress;User Id=sa;Password=pass@123;Initial Catalog=test");
RIM SinghPosted Jun 17, 2013, 9:37 AM
it is not working..