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!!!

8 Years
Discussion Span
Last Post by kurtzky

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


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?

Edited by kurtzky: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.