1
Looks like i misread your question. Now I got it.
First thing is, are you been able to connect to SQL Server through Management Studio. If yes, you should have user Id, password and a database name.
After you succeed in doing above, you can use answer given by Abhilash.
The fact that you are talking about Server Properties, probably you have logged in. If yes, did you not use user Id and password? If not, you probably logged in using Windows Authentication.
If you are using Windows Authentication, your connection string would be
connectionString="Server=SQlServerName;Database=YouDatabaseName;Trusted_Connection=True;"
Accepted 2
I cannot buy that you didn't have to worry about connection string while using EF. How were you creating the context? You must definitely had a context name.
If yes, go in web.config and you will find a connection string named after your context name there.
2
Go=>Tools=>Connect to database=>new window will be open fill details.
click on ok=>go=>server explorer=.right click=>check property=>connection string,,,that's it
2
Try this inside Web.Config file.
- <configuration>
- <connectionStrings>
- <add name="SQLDbConnection"
- connectionString="Server=SQlServerName; Database=YouDatabaseName; User Id=userid; password= password"
- providerName="System.Data.SqlClient" />
- </connectionStrings>
- </configuration>
0
follow this link for more information:
https://msdn.microsoft.com/en-us/library/jj653752(v=vs.110).aspx
0
Hi Nitin,
I am not using EF so there is no context whatsoever.
So, I have to connect directly to the dataSource which is Ms SQL 2016 but I do not know what to put at the Connection String DataSource there at the web.config.
Can you pls advise me ?
0
Hi Abhilash,
Can I know YourDatabaseName is it referring to the name in the Server Properties ?
Cos the Server Properties it is using my name....
Also, is it necessary to put in User Id and password ?
Where can I find my User Id and password in the system ?
Pls clarify.
Tks.