Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Object reference not set to an instance of an object - from DataSet

Posted on 2006-11-27
6
Medium Priority
?
2,706 Views
Last Modified: 2009-05-28
I am using visual web developer express and I am suddenly getting this error message when I try to build my site:

Error      1      Failed to generate code. Object reference not set to an instance of an object.      C:\Documents and Settings\cut\My Documents\Visual Studio 2005\WebSites\WebSite38\App_Code\MyDataSet.xsd      1      

My dataset was working fine until I opened up Visual Web Developer Express this morning and created a new query on my table adapter using the add query wizard.

Does anyone have any idea what might be going on?
0
Comment
Question by:bizcrown101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 11

Expert Comment

by:ethoths
ID: 18019749
This is usually cause by either not calling New on an object or an null reference being trurned from a method that you expect to return an object. Since this is inside the auto-generated code of xsd yiou don't have too much control over the code in there. My guess is that either you cannot access the database or something in the database has changed. My advise would be to delete the xsd and regenerate it.

0
 

Author Comment

by:bizcrown101
ID: 18019984
Any idea as to what I might look for in the xsd file?

Aside from the one error message, I also get an INSANE amount of warnings about properties in my dataset being empty or null. It's almost as if there should be an instance of my dataset class instantiated somewhere, but it is missing. Is there somewhere in my project where an instance of this class should be created?
0
 
LVL 11

Expert Comment

by:ethoths
ID: 18020010
I would not try to debug the dataset. Any cahanges you make in the auto-generated code will be lost if you need to re-generate the code. Like I said, just delete it and re-create it. If you made it by dragging a stored procedure from the server explorer it'll only take a few minutes.

0
 

Author Comment

by:bizcrown101
ID: 18020218
Rather than deleting the dataset and rebuilding it from scratch (I’m not using stored procedures), I opted to right-click on all the methods on all my table adapters and select "configure". I think this forced all the xml code to be re-built without me having to re-type in all my queries.

This seems to have fixed whatever problem was with my auto-generated dataset code.

Thank you for your suggestions ethoths.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18225498
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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