aspx thread: Problems filling an array using the Database Info...
Hi all,
I?m trying to develop a little calendar app with asp.net wich should read
the records in a database one by one to fill an array with some
coordinates wich is stored there.
Then by code, it put the ?little description? field on the filled days
(previously stored on the database).
As you can see in another recently post of mine, I know exactly how many
fields contain the database using the executeScalar method, so I thought I
could use that info to advance with the ?fill array? task, but it doesn?t
works as I thought.
This is a little example of the code wich I try to insert the diferent
fields info on the array (once I have counted the number of fields):
...
dim objCmd3 as new OleDbCommand ("select anyo as Yearr from tbCalendar" ,
Conn)
...
Try
ObjCmd3.Connection.Open()
'Mientras se están leyendo datos
for i=o to CountedRecords
matrix2 (i) = objCmd3.ExecuteScalar
Next i
Finally
ObjCmd3.Connection.Close()
myReader.Close ()
Conn.Close()
end Try
----
So I thought ExecuteScalar would insert the query info on the array each
time, but it just write the first field info every time the bucle turns.
(I know it because I do a simple ? response.write (matrix(i)) ? with
another bucle For.
Please, could someone orientate me about how to complete this task?
I'm using Asp.net and an Access (mdb) Database.
It would be cool a method where I could run through the ID field on my
database from the query but using a variable, so I could then insert the
exactly field info on each position on the array.
Hope it been a clear doubt...
Thanks a lot in Advance!!
From Spain:
Salvador Gallego.