473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Putting Array Object Into Database

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


Jul 21 '05 #1
0 1375

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eric Kincl | last post by:
Hello, its been a while since I posted/looked here... my normal email client doesn't handle newsgroups :( (ximian evolution) I was wondering how you stick a file into a database, and then...
2
by: John Wilson | last post by:
Hello friends, I have this dynamic array(shown below) that I need to match to values (1 - 10) that I am returning from the database via DSN connection object. The values I need to match are on...
11
by: Laphan | last post by:
Hi All I'm using .getRows() with a local var array instead of doing a recursive loop so that I'm being a good ASP newvbie and closing my object i/o's (the recordset in this case) as quick as...
1
by: Nicole | last post by:
Hello! I hope there is someone out there who can shed some light on this for me. I have a module that is supposed to look at an access table, pull out each bid record, link to another table to...
6
by: Carl | last post by:
Hi, I want to pass an array of object of different type to a function and use it in the function. I am not able to have it working. Function that create the array... public virtual DataSet...
0
by: EMiller | last post by:
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...
2
by: assgar | last post by:
I am having problems getting the user selected form info to inserted into the mysql database. I am also rec eving an error: Warning: Variable passed to each() is not an array or object in ...
0
by: Anish G | last post by:
Hi, I have an issue with reading CSV files. I am to reading CSV file and putting it in a Datatable in C#. I am using a regular expression to read the values. Below is the code. Now, it reads...
2
by: Peter | last post by:
I have OLE Object field in Access Database. This field contains an array of floats. The array was moved from memory into a string and the string was saved as OLE Object in a database (That was...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.