[Mono-dev] Arrays in a loop?

SigmaX scottclansman at cwazy.co.uk
Tue Oct 4 22:41:54 EDT 2005


Gaurav Vaish (Mono) wrote:
>>                            lms_table[i, 0] =
>>    Convert.ToSingle(row[keytext]);
>>                            lms_table[i, 1] = Convert.ToSingle(row["L"]);
>>                            lms_table[i, 2] = Convert.ToSingle(row["M"]);
>>                            lms_table[i, 3] = Convert.ToSingle(row["S"]);
>
> Change all conversions to something like:
>
> row.IsDBNull("L") ? 0 : row.GetFloat("L")
>
> 0 can be replaced with some default value.
> What is happening is that in case of NULL values (in DB), conversion 
> fails.
>
>

Thanx for the tip, but I get:

    'System.Data.DataRow' does not contain a definition for
    `IsDBNull'(CS0117)


When I try to use your suggested fix. 
    Any help?
        Thanx,
              SigmaX

-- 
My home page: www.sigmax.cjb.net

"Education is what remains after one has forgotten everything he learned in school"
	-Albert Einstein





More information about the Mono-devel-list mailing list