Gridview in website- Accessdatasource => Cannot use query builder, get error message shown

Posted on 2008-11-10
Last Modified: 2012-05-05
On my webpage I can drag a gridview object onto the page, and I have to also pull down an AccessDataSource which will bind the gridview to my Access Database assigning the query string and the query and other perameters.

The problem is

(1) If I try to 'configure data source' I cannot browse for my database, all that is shown is the folders within the project (App_Code, App_Data and Bin), which is strange, because I think I remember being able to Browse previously. So, I have to type in the folder and drive by hand. (Although I just read someone else mentioning this somewhere and said that they don't think the browse feature is fully implemented...)

(2) So, that seems ok, but then when I choose 'next' I get to the place where I have to define the query. So, I try to click on the 'query builder' button to bring up the query builder, and I get the error message 'Object reference not set to an instance of the object'.

So, something strange is going on. While the page will run fine, and gas long as the queries are correct the tables will be updated properly, I can't use visual studio functions properly since it doesn't seem to be finding the database? Not sure what is going on here... any help?

Thanks, Aiden
Question by:AidenA
    LVL 83

    Expert Comment

    Visual Studio expects to have the database within the solution. Right on the project and add the App_Data folder. Then import the database file into this folder and everything should work fine.

    Author Comment

    But I mean, that can't be the case surely? I imagine that there are plenty of applications where the database is not going to be contained within the project?

    In fact, everything works fine, I can actually implement everything with the database being held outside of the project. But the problem is that I can't use the querybuilder. So, I imported the file to the project just to see if the querybuilder works, and it is the same problem again.

    I came across someone else who seemed to have the exact same problem and that person said:

    "I tried everything under the sun to fix this issue. Nothing worked. For an unrelated reason, I upgraded by hard disk and manually installed all of my software (as opposed to transferring the data/applications) in hopes that if something was corrupt; it would not be copied over. That did the trick. I downloaded Visual Web Developer and it now works. I am assuming files and/or settings were either corrupted or incorrectly set. "

    So, this is what I've been kind of thinking myself since I seem to be getting all sorts of funny errors the last few weeks. An error in vs came up previously even that suggested that there might be some corrupt memory on the computer. So, the computer is getting rebult tomorrow, hopefully that might help

    Thanks Aiden

    Accepted Solution

    Yes, that has fixed the problem. Basically just got a new computer and reinstalled everything. Querybuilder comes up now. Think there might have been some faulty memory or somthing like that.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now