-
ADO.net Connection String
have a login form in which I want to enter the UserID and Password and then
pass it as a parameter for ADODB connection string.
here is the code:
Dim cn As New ADODB.Connection()
cn.ConnectionString = "provider=sqloledb;server=66.134.31.35;database=northwind;uid=sa"
cn.Open()
-
Re: ADO.net Connection String
I'm not sure what the question is here? Typically you can store the
value (best if encrypted) in your app.config file, and then use the
built-in Configuration object to retrieve the value:
In your app.config file:
<appSettings>
<add key="connectionstring" value = "Data Source=servername;user
id=sa;password=xxx;Initial Catalog=tttt"/>
</appSettings>
To retrieve value, import system.configuration, and use code like:
dim conString as string =
ConfigurationSettings.AppSettings("ConnectionString")
-- Jim F.
>have a login form in which I want to enter the UserID and Password and then
>pass it as a parameter for ADODB connection string.
>
>here is the code:
>
> Dim cn As New ADODB.Connection()
> cn.ConnectionString = "provider=sqloledb;server=66.134.31.35;database=northwind;uid=sa"
> cn.Open()
-- Jim F.
http://www.fmsinc.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks