OleDbException with OleDbParameters
I'm getting the following exception when i try and insert data into an excel sheet using ado. I've tried changing the OleDbType but nothing seems to work and was hoping that someone could maybe tell me what i'm doing wrong or if it's because an excel cell is set to hold 255 characters? if so why can i paste the data into an excel sheet?
A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
System.Data.OleDb.OleDbException: The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at DsgSave.FileOperation.PerfomAdoExcelWrite(String filename, Int32 size, DataSet ds) in C:\Documents and Settings\derekklingman\My Documents\Visual Studio 2005\Projects\CDEnvironment\DsgSave\FileOperation.vb:line 277
Re: OleDbException with OleDbParameters
Is that second argument to PerformAdoExcelWrite the size of the string parameter? If so, what value are you passign and how long is the string?
Also, note that ADO and ADO.NET are not the same thing. If you say ADO people will assume that you mean the pre-.NET version.