Hi
I have an array which can hold up to 20 entries. The problem is that my array will never contain the same amount of information in it. Example: sometimes the array will be filled with 4 entries and sometimes with 20. I want to output whatever is in my array to my database.
How would I do it if I don't know how full my array is?
Any help appreciated.
Here is the code I use for writing to the database:
I have an array which can hold up to 20 entries. The problem is that my array will never contain the same amount of information in it. Example: sometimes the array will be filled with 4 entries and sometimes with 20. I want to output whatever is in my array to my database.
How would I do it if I don't know how full my array is?
Any help appreciated.
Here is the code I use for writing to the database:
VB.NET:
Dim Conn As New ADODB.Connection
Dim Rec As New ADODB.Recordset
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=c:\Testdb.mdb"
Conn.Open()
Rec.Open("SELECT * FROM Table2", Conn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
Rec.AddNew()
Rec.Fields("Question").Value = myarray --------DONT KNOW WHAT TO DO HERE...
Rec.Fields("Date and Time").Value = Date.Now
Rec.Update()
Rec.Close()
Conn.Close()