if(reader.Read())
{
result = new Customer((string)reader["CustID"], (DateTime)reader["BirthDate"],
(string)reader["Name"], (string)reader["Sex"],
(short)reader["NameFormatCode"]);
}
"Ray Booysen" wrote:
> Hi amjad
>
> Would it be possible to post some code?
>
> amjad wrote:
> > System.InvalidCastException: Unable to cast object of type 'System.Byte' to
> > type 'System.String'.
> >
> > i am using sql serve 2005 and asp.net 1.1
> > i dont know why i am getting that error i am not uisng any byte type i have
> > three type of data in sql varcha datetime and tinyint....
> > any body have any idea how to reslove that problem as i am uisng sqlreader
> > to read the data and save it in local variables. thanks
> >
>
|