Hello,
I am encountering a development challenge here that seems
to be stumping me.
I am developing a C#/.NET application using an MSDE
database. There is a particular field in a table that I
need to accept a two-dimensional array of integers. When
creating the database, I chose the SQL_Variant datatype
for this column to which I will be writing the array.
In my code, I create the array, fill in the data, and when
it comes to write time, I do the following:
ASB2003.OrderDataSet.Order_InforRow NewOrderRow;
NewOrderRow.Services = SaveArgs.m_COrderData.ServicesArray;
orderDataSet1.Order_Infor.Rows.Add(NewOrderRow);
Where ASB2003 is the application namespace and
orderDataSet1 is the active dataset for the table in
question. So here I create a new row, and copy to it the
services array. I then add the new row to the order
dataset. All is well, and when I look at the order dataset
in Debug, the new row is added to the dataset,the array is
nicely nestled where it should be in its list of items,
and I can see all the lovely data has persisted.
But, when it comes to updating the database using this
function, where OrderDataAdapter is the data adapter for
the order table:
OrderDataAdapter.Update(orderDataSet1);
an exception occurs, and it is
"System.Data.OleDb.OleDbException: Unspecified error"
Why is this happening? The row I created was happy with
everything, why would the update not take it?
Does the SQL_Variant not accept the type of data
(System.Array) that was contained in the row for that
column?
Any ideas you may have about putting an array into the
database will be met with much gratitude!
Thank you one and all!
Eric