Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Fill datagrid without database

Reply
Thread Tools

Fill datagrid without database

 
 
Yoramo
Guest
Posts: n/a
 
      06-29-2003
Hello

I need to fill in my datagrid from calcutalted date. how do I fill in my
datagrid?

yoramo


 
Reply With Quote
 
 
 
 
Tim
Guest
Posts: n/a
 
      06-29-2003
could you be a little more specific?

"Yoramo" <(E-Mail Removed)> wrote in message
news:Ow#(E-Mail Removed)...
> Hello
>
> I need to fill in my datagrid from calcutalted date. how do I fill in my
> datagrid?
>
> yoramo
>
>



 
Reply With Quote
 
 
 
 
Steve Letford
Guest
Posts: n/a
 
      06-29-2003
You can create a datatable fill in your details and bind it to your
datatable.

Steve

"Yoramo" <(E-Mail Removed)> wrote in message
news:Ow%(E-Mail Removed)...
> Hello
>
> I need to fill in my datagrid from calcutalted date. how do I fill in my
> datagrid?
>
> yoramo
>
>



 
Reply With Quote
 
yoramo
Guest
Posts: n/a
 
      06-30-2003
Thanks I'v done it here is an example of it.

// create a DataTable
DataTable aTbl = new DataTable("Test") ;
DataColumn aClmn ;
aClmn = new DataColumn("aaa") ;
aClmn.DataType= System.Type.GetType("System.Char");
aTbl.Columns.Add(aClmn) ;
aClmn = new DataColumn("Count") ;
aClmn.DataType= System.Type.GetType("System.Int16");
aTbl.Columns.Add(aClmn) ;
aClmn = new DataColumn("Frequency") ;
aClmn.DataType= System.Type.GetType("System.Double");
aTbl.Columns.Add(aClmn) ;
aClmn = new DataColumn("RealChar") ;
aClmn.DataType= System.Type.GetType("System.Char");
aTbl.Columns.Add(aClmn) ;
// fill in the relevant data
for (char ch = 'A' ; ch <= 'Z' ; ch++)
{
int Row = ch - 'A' ;
DataRow aRow;
aRow = aTbl.NewRow() ;
aRow["aaa"] = ch ;
aRow["Count"] = _Table[ch] ;
double aFreq = (100.0 * _Table[ch]) / _Table.TotalCount ;
aRow["Frequency"] = aFreq ;
aTbl.Rows.Add(aRow) ;
}
dataGrid2.DataSource = aTbl ;


thanks
Yoramo


"Steve Letford" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> You can create a datatable fill in your details and bind it to your
> datatable.
>
> Steve
>
> "Yoramo" <(E-Mail Removed)> wrote in message
> news:Ow%(E-Mail Removed)...
> > Hello
> >
> > I need to fill in my datagrid from calcutalted date. how do I fill in

my
> > datagrid?
> >
> > yoramo
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
PDF forms filling with ASP.NET, interactive forms, fill and write to database (iText or FDF Toolkit or ...) Toni Pohl ASP .Net 1 08-10-2008 01:40 PM
fill combo box with data from database Eugene Anthony ASP General 4 07-14-2005 02:58 PM
Newbie question: Fill dataset will ALL tables from database Pierre van Rooyen ASP .Net 3 05-21-2004 07:43 AM



Advertisments