Re: Cannot display ODBC login prompt - want to connect without DSN
- From: "Scott M." <s-mar@xxxxxxxxxxxxx>
- Date: Sun, 27 Sep 2009 13:29:01 -0400
ODBC was effecitvely replaced by OLE DB Providers about 10 years ago and
these providers are available in .NET.
Depending on the database you are using, you'll need a specific provider
with a specific connection string to match it. If you want the user to be
able to supply their user ID and password, that would be a simple matter of
providing a logon form and then take the data from that form and make it
part of the connection string.
For SQL Server, you'd have something similar to this:
Dim con As New System.Data.SqlClient.SqlConnection(connectionStringHere)
Try
con.Open
'use connection here
Catch e As Exception
'handle exceptions here
Finally
con.Close()
con.Dispose()
End Try
Various configurations of connection strings can be found here:
http://ConnectionStrings.com
-Scott
"John Brown" <JohnBrown@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E7322825-2163-4B59-9AA4-0085AB397727@xxxxxxxxxxxxxxxx
"Mark Rae [MVP]" wrote:
"John Brown" <JohnBrown@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5F054111-768C-4FD8-86FF-468FB02F9312@xxxxxxxxxxxxxxxx
2) More generally, is there an equivalent to the
ADODB.Connection::Properties collection in ADO.Net?
More pertinently, why on earth are you using ODBC...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
And what, pray tell, should I be using?
.
- Follow-Ups:
- Re: Cannot display ODBC login prompt - want to connect without DSN
- From: John Brown
- Re: Cannot display ODBC login prompt - want to connect without DSN
- References:
- Cannot display ODBC login prompt - want to connect without DSN
- From: John Brown
- Re: Cannot display ODBC login prompt - want to connect without DSN
- From: Mark Rae [MVP]
- Re: Cannot display ODBC login prompt - want to connect without DSN
- From: John Brown
- Cannot display ODBC login prompt - want to connect without DSN
- Prev by Date: Re: Cannot display ODBC login prompt - want to connect without DSN
- Next by Date: Re: Cannot display ODBC login prompt - want to connect without DSN
- Previous by thread: Re: Cannot display ODBC login prompt - want to connect without DSN
- Next by thread: Re: Cannot display ODBC login prompt - want to connect without DSN
- Index(es):
Relevant Pages
|