Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataSet Fill Issue

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
I have a dataset which contains 17 fields - 6 strings, 1 boolean and the rest double. 4 of the 6 string fields store data in relation to "Visual Inspection". If any of these 4 fields contain data, filling the dataset throws a NullReferenceException error. However, when they are all blank the dataset works fine.

This is regardless if any of the other fields contain data. Can anyone throw light on what could be causing this issue as it is baffling me.

Mighty
 
Found out what the source of the problem was. I had a checkbox and a number of comboboxes in my datarepeater. I had event handlers for all these fields. For example, if the checkbox was ticked I wanted to hide all other fields on that row of the datarepeater. What was happening was that these event handlers were being fired when the datarepeater was databound. As a result, the function was trying to hide fields which had not been created yet.

I have just prevented the functions carrying out the tasks if they are called when the data is binding. Problem Solved!!

Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top