Author: Mica77 | Posted on: 2/3/2009 7:07:00 PM | Views : 498

Hi,
I am unable to get around the following problem...
I am using SQLserver and trying to write data from db1 to db2
In db1 the field is nvarchar...  In db2 it is Int

All the data is db1 is either Null or a number suitable for int type
I am getting casting errors.  I have tried the following solutions
                scomm.Parameters.Add("@7", SqlDbType.Int).Value = Convert.ToInt32(aread(6))
tried to convert in params but was unable to account for Null Values
                scomm.Parameters.Add("@7", SqlDbType.Int).Value = Convert.ToInt32(aread(6).ToString + "")
tried to use the same method but to enforce a Null value if there was an emtpy read            & ...

Go to the complete details ...