binding multideminsional arrays

windows

Guest
I store my purchase orders, partno and qty ordered in a cookieless session, serverstate. When a user clicks on View cart this queries the database and gets the unitprice, partname info and places it in a multi-deminsional array. EX: ArrCart(3,100). What I would like to do is bind this array to a gridview and add delete, and changeqty functions to it. Can someone tell be how to bind the array to a grid. I'm using asp.net 2.0 with studio '05Well i didnt try to bind a multi-dimensional array before, but i think its like the one-dimensional binding
GridView1.DataSource = Array
GridView1.DataBind()

then in the GridView columns, you can specify DataField if you use BoundColumn or use the Binder.Eval if you are using TemplateColumns.
But i have suggestion, why dont you bind directly from datasource, instead of using multi-dimensional array?!!just a suggestion going a little off the subject, have you consider when user click "view cart", your queries return a dataset instead of a muti-dim array?

you probably have a little easier time to bind, navagate dataset then muti-dim array.
you may also have a little easier time to copy the sql result set to a dataset, instead of copy to a array.
 
Back
Top