473,387 Members | 1,790 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,387 software developers and data experts.

Binding an Array to a DataGrid

Hi, I am very new to ASP.Net, kindly help me. This is what i want to do.
I am primarily working on two classes PatientInfo and PatientInfoUtility.
PatientInfo:
PatientInfo is the class object that stores the data representation of the patients table in the database.It exposes properties such as name, Id, City etc.
And it provides the following Constructors
public PatientInfo()
– all values populated with defaults
public PatientInfo(string id, string first, string last, string suffix)
– rest populated with default values which can be set manually
public PatientInfo(DataRow dr)
– values populated from the database
PatientInfoUtility
The PatientInfoUtility provides database access to this table and provides the following method:
public ArrayList RetrieveAllPatients(bool active)
– retrieves active patients if 'active' is true, otherwise, returns the inactive patients

Now i do not know how to bind this array to a datagrid. Can anyone please help me.

Thanks
Zaid Papa
Feb 20 '07 #1
1 1733
shweta123
692 Expert 512MB
Hi,

This is how you can bind the Arraylist to Datagrid

Dim a1 as new Arraylist=RetrieveAllPatients(........)

Datagrid1.Datasource = a1
Feb 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: GingerNinja | last post by:
Hi Everybody, its about my 4th day on C# and all seems to be going smoothly however I've started to get into Datagrids and in particular binding data sources to them. In the documentation it says I...
0
by: David Steward | last post by:
When looking at the help files for datagrid I see a lot of information for how to data bind the datagrid to a database. The help information mentions that data binding can be done also to an...
3
by: Just D | last post by:
Hi, If anybody needs to show some data retrieved from the database table, what method is more preferrable? 1. DataSet ds = ...; DataGrid.Data.Source.ds; DataGrid.Bind(); 2. Write a custom...
3
by: Jim Bancroft | last post by:
Hi everyone, I'm binding an ArrayList to a DataGrid for the first time (I'm used to binding DataSets and DataTables) and I was wondering if I could somehow "name" the ArrayList, so that I can...
1
by: epigram | last post by:
Well, conceptually this is what I want to do. I was hoping to use an ArrayList to build a (dynamic) array of string arrays, and then bind the ArrayList object to a DataGrid. I can do that, but it...
8
by: mark | last post by:
What I have is three forms. Form one with buttons 1, 2 and 3; and forms 2 and 3 with datagrids. Button 1 populates arrays a(i,j) and b(i,j) with values. Button 2 creates a datatable containing...
5
by: Rami | last post by:
Hey, I Tried to bind a DataGrid to an ArrayList, and had 2 problems: 1. The DataGrid shows the Length property of the items instead of their text - how can I change that? 2. After binding, I add...
4
by: Jim Shaffer | last post by:
Perhaps I have the wrong construct, or misunderstand arrays in vb (2003).... I've loaded a two-dimensional array (168 by 28) into memory as AcctArray. {Dim AcctArray (500,28) as string...} The...
1
by: Ed | last post by:
Hi there, I have a two dimensional array which I would like to bind to a datagrid, however I've spent all afternoon googling for a solution and I can't find one anywhere. The best I've come up...
4
by: Alan Gillott | last post by:
Is it possible to bind a Datagrid to a 2 dimentional Array? Or even a Collection? I know Linq can in vb2008 but I don't want to download 2008 just yet. Lots of examples binding text boxes to Id...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.