Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem Reading DataRow Value
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01352048
Message ID:
01352059
Views:
28
Thank you


>>I'm reading the value of a column in a dataset into a textbox:
>>
>>
>>txtAuthor.Text = (string)oDataSet.Tables[0].Rows[0]["Author"];
>>
>>
>>On some records, the Author is null, so I get a cast exception. Can someone help a newbie?
>
>You should be able to use this syntax:
>
>
>txtAuthor.Text = (string)oDataSet.Tables[0].Rows[0]["Author"] ?? "";
>
>
>If the first expression is null it will use the second instead.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform