Large numbers in ADO.net

  • From: "Sean Mealin" <seanpm@xxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 23 Apr 2009 00:08:02 -0400

Hi all,

I'm having a problem with ADO.net that I just can't seem to figure out.  In
a nutshell, the problem is that I'm trying to write a number that is to big
in a database, but I'm not sure how to fix it.  The number I'm trying to
write is the number of seconds since Jan 1, 1970, so my code looks like
this:

 

Newrow["Update_Time"] = 12345678910;

 

The "Update_Time" is set to a number in the database, and that field size is
set to long integer.  So the whole part of code looks like:

 

DataRow NewRow = MyTable.NewRow();

NewRow["Update_Time"]=12345678910;

NewRow["Update_Name"]="Sean";

MyOLEDBAdapter.Update(MyTable);

 

And I get the error:

Can not convert int64 to int32.

The stacktrace points at the line:

MyOLEDBAdapter.Update(MyTable);

 

I guess I should also say that I'm using an OLEDBCommandBuilder to help with
the OLEDBAdapter object.

 

If I need to give more information, please let me know.  Oh, also the type
of database is an Access file.

 

Thanks so much for any ideas!

 

Sean Mealin

 

Other related posts: