Last post Dec 06, 2018 05:47 AM by Ackerly Xu
Dec 04, 2018 11:01 PM|AppDev01|LINK
I mostly use Integrated Security, mostly.... but now I have a need to use a connection string with a user name and password and I am not sure how it should be formatted...
Do you need quoted arounf the user name and password... not of the MS connection string examples are helpful as they don't say if you should or should not
here is my example:
<add name="EF_DB_Entities" connectionString="metadata=res://*/EF.EF_DB_Model.csdl|res://*/EF_DATA.EF_DB_Model.ssdl|res://*/EF_DATA.EF_DB_Model.msl;provider=System.Data.SqlClient;provider connection string='data source="SERVERDB, 10";initial catalog=EF_DB; User ID=DOM\XX_XXUser; Password=A123A1213; MultipleActiveResultSets=True;App=EntityFramework'" providerName="System.Data.EntityClient" />
Should this : User ID=DOM\XX_XXUser; Password=A123A1213;
be This : User ID="DOM\XX_XXUser"; Password="A123A1213";
It is not 100% clear from the help examples I found Thanks in advance!
Dec 05, 2018 12:17 AM|mgebhard|LINK
Make a connection using either "SQL Server Object Explorer" or "Server Explorer" in Visual Studio. Both Views are found in the View dropdown menu in Visual Studio.
Click theBoth Views have a connection icon where you can use a GUI to connect. Finally copy the connection string from the connection properties window. Properties is also a View if not already present in Visual Studio.
Dec 05, 2018 01:16 AM|oned_gk|LINK
Create a page, in design mode add sqldatasurce, configure it by creating new connection till finish.
In middle wizard you will asked to save connection, save it, you will get it in web.config after finish.
Dec 05, 2018 05:01 AM|wmec|LINK
Try to put this
<add name="conn2" connectionString="Data Source=192.168.?.?\your_db_instance;Initial Catalog=your_db_schema;Integrated Security=False;User ID=your_db_login;Password=??????" providerName="System.Data.SqlClient"/>
within Web.config/app.config file in your project, to ensure the project will work fine with the database.
Dec 06, 2018 05:47 AM|Ackerly Xu|LINK
You could create a new Ado.Net Entity Data Model ,on the wizard, click new connection, then change authentication to SQL Server Authentication,enter your username and password,finally click ok, visual studio will automatically add the connection string to