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 14:04:40
 
 
To
10/05/2004 13:36:17
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00902399
Message ID:
00902538
Views:
18
JIhn,

Did Bonnie's reply answer your question?

>PMFJI, Kendall:
>
>I had this in a method:
>
>
>     if(dr["col_type"]=="varchar")
>          do something
>
>
>that failed with an error until I did this:
>
>
>     if(dr["col_type"].ToString() == "varchar")
>          do something
>
>
>I'm having trouble understanding this concept. If its a string in the debugger, why does it fail on the comparison. My guess is that the dr("x") is an object containing type string. Is that correct?
>
>
>
>
>>>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
>>
>>}
>>
Kendall Webb
Senior Software Engineer
MCAD.Net/MCSD.Net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform