Click to See Complete Forum and Search --> : Size of OleDbType Fields


dvlpr
July 27th, 2002, 09:05 PM
How do you figure out the different field sizes for OleDbType?

OleDbType.Integer is 4
OleDbType.VarChar is whatever the string length is

but what about the Date, Decimal, Numeric and all the other available types? I tried sizeof() but it only works on classes, not fields. Anyone have any ideas?

CPCericola
August 7th, 2002, 05:52 PM
Originally posted by dvlpr
How do you figure out the different field sizes for OleDbType?

OleDbType.Integer is 4
OleDbType.VarChar is whatever the string length is

but what about the Date, Decimal, Numeric and all the other available types? I tried sizeof() but it only works on classes, not fields. Anyone have any ideas?

Have you tried SizeOf(System.DateTime) for OleDbType.Date? If you read the following link, it tells you what each of various OleDbType's map too.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataOleDbOleDbTypeClassTopic.asp

I hope this helps you out.

adegbola
December 15th, 2007, 12:38 PM
Won't someone come up with an answer to this post. I have the same problem. I cannot find the correct size for the OleDbType.Date. In a few days time, I will have problems with the others.