Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
On connection, No Database are retrieved from SQL Server, instead an Error Message comes.

Database Connection String coming: Data Source=SANJOYDAS-PC;
initial catalog should be musicstore but not accepted by system.
Persist Security Info=True;User ID=sa

What I have tried:

I tried with connection in C# Add new Item.
Posted
Updated 16-Jun-19 1:22am
v4
Comments
Richard MacCutchan 15-Jun-19 9:36am    
"instead an Error Message comes."
Sorry we cannot guess what it says.

So, please edit your question, show the code, including the full text of the connection string, and the full text of the error message.
Richard MacCutchan 16-Jun-19 3:30am    
Please read my message above, and add the information exactly as it exists in your code, and the message exactly as it appears. What you have added above is far from clear.

You are missing "Initial Catalog" means Database Name in your connection string.
 
Share this answer
 
Depending on database provider a connection string might differ...
See:
Connection String Syntax | Microsoft Docs[^]
ConnectionStrings.com - Forgot that connection string? Get it here![^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900