>I'm doing this:
>
>
>_RoleKey = (int)dsDataSet.Tables[0].Rows[0]["RoleKey"];
>
>
>It's throwing an exception because RoleKey is null in the data. How do I handle this?
You can branch the logic into two paths by checking for DBNull.Value first.
Also you may want to define your _RoleKey as int?
If it's not broken, fix it until it is.
My Blog