| | |
How to remove uid and password in connection string?
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
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 app application array bitmap box c# check checkbox client color combo combobox concurrency control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset datatable date/time datetime degrees dll draganddrop drawing enabled encryption enum excel file filename files finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization gtk image input install installer java list localization math microsoftc#visualexpress mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remoting richtextbox save server sleep socket sql sql-server statistics string table text textbox thread time timer timespan update usercontrol users validate validation visualstudio webbrowser webcam wia winforms wpf xml





