|
-
Mar 24th, 2002, 01:38 PM
#1
Thread Starter
Addicted Member
asp.net dsn connections
Hi can someone give me an example of how to connect to an Access 2000 database using asp.net with a dsn.
Thanks
Alex
ASP, SQL, VB6, Java Script and dubious guitar playing skills.
-
Mar 27th, 2002, 08:14 PM
#2
Frenzied Member
Put this at the top of your Web.Config file inside the "Configurations" node.
<!-- SETTINGS
Section containts global constants for application.
-->
<appSettings>
<add key="DSN" value="Initial Catalog=DBName;Data Source=localhost;Integrated Security=SSPI;uid=IUSR_GUEST" />
</appSettings>
Then this bit of coding
Dim dsn As String = ConfigurationSettings.AppSettings("dsn")
will return the value in Web.Config.
-
Apr 1st, 2002, 10:53 AM
#3
Thread Starter
Addicted Member
So you cant just put dsn=myDsn in the connection string like good old asp?
Alex
ASP, SQL, VB6, Java Script and dubious guitar playing skills.
-
Apr 1st, 2002, 11:03 AM
#4
you can still do that also. I think that using it the way shown is better becuase if you need to make changes it is always better to do so in one place in case you need to use it in multiple pages.
-
Apr 1st, 2002, 11:06 AM
#5
Thread Starter
Addicted Member
Thanks Cander can you post an exampe of using both ways? I get some weird message about could not find provider if I try to do it the way I would in old asp.
Thanks,
Alex
ASP, SQL, VB6, Java Script and dubious guitar playing skills.
-
Apr 4th, 2002, 12:11 PM
#6
Frenzied Member
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
|
Click Here to Expand Forum to Full Width
|