Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am trying to my C# program to a SQL Database. This is my code for making the c

ID: 3765534 • Letter: I

Question

I am trying to my C# program to a SQL Database. This is my code for making the connection: SqlConnection con = new SqlConnection(@"Data Source=LORI-PCSQLEXPRESS;AttachDbFilename=C:Program FilesMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLDATAProjects.mdf;Integrated Security=True;User Instance=True"); However, I get an error that states that an error occurred in the pre-login handshake and that the wait operation timed out. I'm assuming that this is because I don't have my login information on my connection string anywhere, but I could be wrong. Please help.

Explanation / Answer

Answer :

Try to run The following command in command Prompt

netsh Winsock reset

(or)

Clean your VS.Net Solution--> Rebuild Project.---->Reset IIS---->Run the project again.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote