We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,602 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Error on Release Mode but works fine in Debug Mode (DataSet fill)

Hi all. This is the scenario that i have right now.

i have a stored procedure created in MS SQL 2000 and is linked to my C# program. The stored procedure contains four select statements (which means it will return 4 tables). In my program, I have four datagrids and one data view. Upon clicking a button, it will execute the stored procedure and the command da.Fill(ds), and from that, the program will fill all the data grids. Say, DataGrid1.Datasource = ds.Tables[0], DataGrid2.Datasource = dt.Tables[1], and so on..

Here is my problem. In Debug Mode, it works fine. It returns four tables and it fills all the datagrids correctly. I tried to use Release Mode, it runs correctly if I'm running the entire program (pressed F5), but if I run the .exe file in \bin\Release, and clicked the button that I have in my program, I am getting an "object reference not set to an instance" error. It only returns two tables, not the entire four tables.

Thanks in advance!!!

2
Contributors
2
Replies
6 Days
Discussion Span
2 Years Ago
Last Updated
3
Views
Question
Answered
kurtzky
Newbie Poster
9 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Do you have more than one application in your project? Maybe there's some configuration that's not getting loaded, in that case?

alc6379
Cookie... That's it
Team Colleague
2,821 posts since Dec 2003
Reputation Points: 186
Solved Threads: 149
Skill Endorsements: 3

actually I already solved this problem. I think it has something to do with the broken connection. Can someone here explain why this happens only in Release Mode? Memory allocation issues?

kurtzky
Newbie Poster
9 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 2 Years Ago by alc6379

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0591 seconds using 2.67MB