Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to: Refer to the values from a column
Message
From
10/05/2004 13:49:28
Bill Benton
North Florida Software Services
Middleburg, Florida, United States
 
 
To
10/05/2004 13:44:47
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00902399
Message ID:
00902531
Views:
18
Good question!!! Actually, there are two other bound textboxes on the form, that are bound to an employee table. I might be better plugging in those values and bind the control to the dataset. I think I'll try that.

Thanks for waking me up!



>Bill,
>
>I notice that you're using two different Combos. Are they both showing correct Text?
>
>Also, this has nothing to do with your problem, but I'm wondering why you are manually plugging data from a Combo to a DataTable instead of using data binding?
>
>~~Bonnie
>
>
>
>>This is the error I am receiving. The drPMRLog is returning a new row, with the columns, except for the PK that has iterated, set to NULL.
>>
>>Line 196: this.oPMRLog.NewRow();
>>Line 197: DataRow drPmrLog = this.oPMRLog.DataRow;
>>Line 198: drPMRLog["Title"] = VFPToolkit.strings.AllTrim(this.cboPosition.SelectedItem.Text);
>>Line 199: drPMRLog["Biz_Unit"] = VFPToolkit.strings.AllTrim(this.cboBizUnit.SelectedItem.Text);
>>Line 200: drPMRLog["Program"] = VFPToolkit.strings.AllTrim(this.cboPosition.SelectedItem.Text);
>>
>>The data from the combo box, when viewed in the debugger is returning the proper value (Not NULL), with the same exception listed below.
>>
>>"[NullReferenceException: Object reference not set to an instance of an object.]"
>>
>>
>>
>>>>I am now experiencing this error on the first replacement "[NullReferenceException: Object reference not set to an instance of an object.]"
>>>>
>>>>I am trying this :
>>>>
>>>>drPMRLog["PMRLog.Title"] = ComboBox.Text
>>>>
>>>>It did, however, add the new row.
>>>>
>>>>

>>>
>>>
>>>Try it without the PMRLog. part of your column name. I'm not sure, but I think that the table name is implicit to the datarow and not necessary here.
>>>
>>>Also, I didn't include this in my sample, but you could also do a check for the existance of the datarow object before attempting to use it.
>>>
>>>Is the value of ComboBox.Text a string in the debugger?
>>>
>>>>pre>
>>>if(drPMLog != null)
>>>{
>>> drPMRLog["Title"] = ComboBox.Text
>>>
>>>}
>>>
Bill Benton
Senior Systems Analyst
Nuvell Financial Services
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform