Hi guys,
having GREAT FUN writing my plugin, I have a problem. Below you find the routine that reads value out of a SQLiteResultSet.
Works fine but only if the value is not null!
If the value is null, I don't see any exception or error message but the plugin does not appear in the MP-Configuration. Simply filling out the null fields with SQLiteBrowser "fixes" the problem....
How do you handle NULLs?
Or do you simply write empty strings when inserting and assume that there are no null values possible?
Thanks!
Daniel
having GREAT FUN writing my plugin, I have a problem. Below you find the routine that reads value out of a SQLiteResultSet.
Works fine but only if the value is not null!
If the value is null, I don't see any exception or error message but the plugin does not appear in the MP-Configuration. Simply filling out the null fields with SQLiteBrowser "fixes" the problem....
How do you handle NULLs?
Or do you simply write empty strings when inserting and assume that there are no null values possible?
Thanks!
Daniel
Code:
static string Get(SQLiteResultSet results,int iRecord,string strColum)
{
if (null==results) return "";
if (results.Rows.Count<iRecord) return "";
ArrayList arr=(ArrayList)results.Rows[iRecord];
int iCol=0;
foreach (string columnName in results.ColumnNames)
{
if (strColum==columnName)
{
return ((string)arr[iCol]).Trim();
}
iCol++;
}
return "";
}