hello every one;
i am making a project. in this , i am using asp.net and c#. but on the run time, there is an error occur in my application. the error is "logain failed for user hp-pc\hp". i am also sending my connection class.
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.
Suthish NairPosted Oct 21, 2011, 8:55 AM
Pravin MorePosted Oct 21, 2011, 8:51 AM
Prabhu RajaPosted Oct 21, 2011, 7:05 AM
sumaira manzoor hussain khanPosted Oct 21, 2011, 6:55 AM
sir, thanks very much for your help. sir, my sql server mode have only window authtication mode not "sql server and window authentication mode. so in this situation , i donot have user id and password . am i right?
regards
sumaira manzoor
Prabhu RajaPosted Oct 21, 2011, 5:33 AM
Check out the Article By Nipun Tomar:
http://www.c-sharpcorner.com/UploadFile/nipuntomar/4741/
You may get Different Connection Strings and Purposes.
Pravin MorePosted Oct 21, 2011, 2:51 AM
try this line
my_connection = new SqlConnection("Server =hp-pc\\SqlExpress;Initial Catalog = fyp;Integrated Security = True,User ID=UsernameofyourSQLServer;Password=passwardofyoursqlserver");
make sure your servername,userID and passward is correct....
Thanks,i hope it will solve your problem.
Pravin.
Dhaval PatelPosted Oct 21, 2011, 2:35 AM
i am seen your screen shot and got error .
first of all you have to open server explorer and Right click on Data Connections and add connections
and then after your data connections created on right click and go to Properties and in properties you seen connection String this string is copy and paste into your sqlconnection connection string and solve your problem.........
If you have help this answer Then mark as "Accepted Answer"
sumaira manzoor hussain khanPosted Oct 21, 2011, 1:50 AM
i implemented your code. but the exception still occur. ok, i am sending screen shot of my connection class with exception . i think , you will understand my code and exception.
regards
sumaira manzoor
Javeed M ShaikhPosted Oct 20, 2011, 4:05 PM
Try this in your connection string:
"Data Source=.;Initial Catalog=sumaira-fyp;Integrated Security=True"
Please do not forget to mark "Accepted Answer".
Suthish NairPosted Oct 20, 2011, 1:23 PM
Refer article: How to: Generate or find Connection String from Visual Studio