Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Filling a data adapter control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Filling a data adapter control

 Post Reply Post Reply
Author
RCorr View Drop Down
Groupie
Groupie


Joined: 21 January 2003
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote RCorr Quote  Post ReplyReply Direct Link To This Post Topic: Filling a data adapter control
    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


Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 30 November 2003 at 9:33am

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

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.