aspx_professional thread: Problems filling an array using the Database Info...
Just a wild guess:
Is this in your code?
for i=3Do to CountedRecords
It says i=3Do instead of i=3D0
Or was this caused when composing this e-mail??
Also, why do you fill the array with the same value over and over again??
In each iteration, matrix2 (i) is filled with the same year value from
"select anyo as Yearr from tbCalendar"
It doesn't really look like a count, but just like an ordinary field
value....
What exactly are you trying to store in the array??
Imar
At 10:57 PM 9/16/2002 +0000, you wrote:
>Hi all,
>
>After post this same message on the aspx standar forum since september
>6th; I didn't get any response, so I thought, maybe it is a profesional
>doubt, or maybe I didn't be too clear. So I hope it to be the first one ;-)
>
>This is my unsolved doubt:
>-------
>Hi all,
>
>I=92m 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 =93little description=94 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 =93fill array=94 task, but it
doesn=92t
>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=E1n leyendo datos
> for i=3Do to CountedRecords
> matrix2 (i) =3D 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 =93 response.write (matrix(i)) =93 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.
>-----------------
>
>
>Hope somebody in this forum can solve it.
>
>If you didn't understand something of this problem, please, don't
>heasitate to tell me.
>
>Thanks for any ideas!!
>
>
>
>---
>
>ASP.NET 1.0 Namespace Reference with C#
>http://www.wrox.com/acon11.asp?ISBN=3D1861007442
>
>ASP.NET 1.0 Namespace Reference with VB.NET
>http://www.wrox.com/acon11.asp?ISBN=3D1861007450
>
>These books are a complete reference to the ASP.NET namespaces
>for developers who are already familiar with using ASP.NET.
>There is no trivial introductory material or useless .NET
>hype and the presentation of the namespaces, in an easy-to use
>alphabetical order ensures a user-friendly reference format.
>We provide in-depth coverage of all the major ASP.NET classes,
>giving you those real-world tips that the documentation doesn't
>offer, and demonstrating complex techniques with simple
>examples.
>
>---