Enhanceing GetString() in BusinessEntity.cs

Is there a feature you'd like us to add? Post it here.

Enhanceing GetString() in BusinessEntity.cs

Postby goodharry@gmail.com on Fri Jun 23, 2006 12:33 am

I would really like to see this following method in place of existing method in future versions of mygeneration.doodads project. (the version i am using is v1.1.5.1)


NOTE: in else clause there is another if clause because if i use LoadbyPrimaryKey or LoadAll method tol oad data from a firebird database table then the data returned in a Blob field is byte[] otherwise if i use Query.Load the blob field returns string. And there is no check for byte in GetString() method. the existing method just returns error when i use LoadbyPrimaryKey or LoadAll methods and try to load blob in a string but with the following change it works fine.


protected string Getstring(string columnName)
{
if(_dataRow.IsNull(columnName))
return String.Empty;
else
if ( _dataRow[columnName] is byte[])
return System.Text.Encoding.UTF7.GetString((byte[])_dataRow[columnName]);
else
return (string)_dataRow[columnName];

}

I hope that u guys will change this in next version of doodads.

cheers,
Harpreet Singh
goodharry@gmail.com
Lurker
 
Posts: 1
Joined: Fri Jun 23, 2006 12:22 am

Return to Enhancements

Who is online

Users browsing this forum: No registered users and 5 guests

cron