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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Oct 21, 2011, 4:55 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Oct 20, 2011, 9:23 AM EDT
Refer article: How to: Generate or find Connection String from Visual Studio
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 20, 2011, 12:05 PM EDT
Try this in your connection string:
"Data Source=.;Initial Catalog=sumaira-fyp;Integrated Security=True"
Please do not forget to mark "Accepted Answer".
sumaira manzoor hussain khanRank #8,900 · 214 reputationPosted Oct 20, 2011, 9:50 PM EDT
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
Dhaval PatelRank #1,023 · 1.9K reputationPosted Oct 20, 2011, 10:35 PM EDT
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"
Pravin MoreRank #1,419 · 1.2K reputationPosted Oct 20, 2011, 10:51 PM EDT
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.
Prabhu RajaRank #861 · 2.6K reputationPosted Oct 21, 2011, 1:33 AM EDT
Check out the Article By Nipun Tomar:
http://www.c-sharpcorner.com/UploadFile/nipuntomar/4741/
You may get Different Connection Strings and Purposes.
sumaira manzoor hussain khanRank #8,900 · 214 reputationPosted Oct 21, 2011, 2:55 AM EDT
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 RajaRank #861 · 2.6K reputationPosted Oct 21, 2011, 3:05 AM EDT
Pravin MoreRank #1,419 · 1.2K reputationPosted Oct 21, 2011, 4:51 AM EDT