|
-
Nov 7th, 2003, 03:23 PM
#1
Thread Starter
Hyperactive Member
very simple question - connecting to db
I'm trying to connect to database using a ASP.NET Web Application.
I drag and drop an OleDbConnection control and then import files,
provide the connection string and test connection to Access NWIND.mdb
Imports System
Imports System.Data
Imports System.Data.Common
Imports System.Data.OleDb
then in the page_load event
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Try
OleDbConnection1.Open()
Response.Write("Success")
Catch dbException As OleDbException
Response.Write("Unable to open database")
End Try
End Sub
It says Unable to open database.
Whereas I do the same steps in Windows application it gets connected to the same database just fine.
I can't figureout what am I doing wrong?
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
|