| | |
How to remove uid and password in connection string?
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2009
Posts: 10
Reputation:
Solved Threads: 0
Hi,
When I use sql server native client for odbc sql connection then it is asking uid and password, once I supply uid and pwd in odbc connection , I think there should not be necessary to give uid and password in C# in sql connection string. I want once we supply the dsn value to odbc sql connection string then it should not ask for uid and password which is already given in dsn creation. How can I resolve it ?
When I use sql server native client for odbc sql connection then it is asking uid and password, once I supply uid and pwd in odbc connection , I think there should not be necessary to give uid and password in C# in sql connection string. I want once we supply the dsn value to odbc sql connection string then it should not ask for uid and password which is already given in dsn creation. How can I resolve it ?
•
•
Join Date: May 2009
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
Hi,
When I use sql server native client for odbc sql connection then it is asking uid and password, once I supply uid and pwd in odbc connection , I think there should not be necessary to give uid and password in C# in sql connection string. I want once we supply the dsn value to odbc sql connection string then it should not ask for uid and password which is already given in dsn creation. How can I resolve it ?
Declare the connection string in web.config.
like below,
<configuration>
<appsettings>
<add key="Connectionstring" value="data source=ServerName;initial catalog=dbname;uid=username of sql server;pwd=password of the sql server">
</add>
</appsettings>
</configuration>
or declare the connection string in form level
public sqlconnection con=new sqlconnection (="data source=ServerName;initial catalog=dbname;uid=username of sql server;pwd=password of the sql server");
Thanks
![]() |
Similar Threads
- How to connection string into a dictionary in php code and vice versa (PHP)
- Connection String (ASP.NET)
- connection string of SqlConnection (C#)
- Connection String (Visual Basic 4 / 5 / 6)
- Connection String (MS Access and FileMaker Pro)
- connection string (ASP.NET)
- Dynamic Connection String Using ADO (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: opening Excel 2003 file by c#
- Next Thread: C# program
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash httpwebrequest image index input install java label list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml





