Print Page | Close Window

Filling a data adapter control

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7723
Printed Date: 30 March 2026 at 8:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Filling a data adapter control
Posted By: RCorr
Subject: Filling a data adapter control
Date Posted: 29 November 2003 at 3:22pm

Hello,

I am trying to work with a database in Visual Studio.NET.  I have created a connection (cnn), data adapter (da), and a data set (ds).

When I click on Data/Preview Data from the menu bar I am able to see the results.

In my code, I have

private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
             da.Fill(ds)       ;  
             dg.DataBind()                         
        }

When I go and run the program, it crashes at da.Fill(ds) and the error message is as followed: 

"Cannot open the file 'C:\Location of databasebase\databaseName.mdb'.  It is already opened exclusively by another user, or you need permission to view its data"

I am working on a stand alone computer and I do not have the database open.  The only logical conclusion I have came up so far is the user id in the connection string may be incorrect. When I change to any other name besides Admin/admin - the connection fails and thus I am in the same situation.

Any assistance would be appreciated.


RCorr





Replies:
Posted By: Mart
Date Posted: 30 November 2003 at 8:55am
If the database has been opened before in your program make sure you close the connection. .NET holds database write permissions if the connection isnt closed.


Posted By: pmormr
Date Posted: 30 November 2003 at 9:33am

THE FUTURE IS NOW... ASP.NET (i'm going to get it and learn it ASAP)



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Mart
Date Posted: 30 November 2003 at 10:00am
You can't just stroll into asp.net just because youve developed in asp before. its a lot differant and it really p'd me off at the start because i didnt understand it. but then you get used to it


Posted By: pmormr
Date Posted: 30 November 2003 at 10:27am
i know.. i'm going to get a book and try and get my hands on a copy of vb.net

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Mart
Date Posted: 30 November 2003 at 10:35am
Your best off waiting for .NET Whidbey (2.0) because its going to be defferant because of all the new things and you will end up having to learn that.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net