PC Review


Reply
Thread Tools Rate Thread

DataGrids and obtaining information from them

 
 
Fred Nelson
Guest
Posts: n/a
 
      12th Apr 2004
I have a stored procedure that returns a one row with large number of
columns (350) to a datagrid "datagrid1" on a web form:

datagrid1.datasource = getcase.getcaseinfo(case#)
datagrid1.databind()

This operation works and it shows the colum name and the value in a table
format.

Once bound I can read the data grid - for example the following code returns
the value in the first column of the first (and only) row:

dim dgitem as DataGridItem = DataGrid1.Items(0)
dim colcnt as integer = dgitem.cells.count
tbxResult.text = "There are " + colcnt + " Colums in the DataGrid "
tbxResult.text += "The value of the first column is: " +
dgitem.cells(0).text.tostring

I would like to obtain the column names and hopefully the data types (eg:
Integer/ Character) for other uses within the program.

For example:
tbxResult += "The first column name is: " + dgitem.cell(0).NAME
tbxResult += "The Data Type is: " + dgitem.cell(0).DATATYPE


Then I would have the Name, Data Type, and value of each item.

Does anyone know a way to do this?

Your help would be greatly appreciated!

Thanks,

Fred


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      13th Apr 2004
Hi Fred,

A datagrid is a view from the user on the screen holding the references to
the datasource
A dataview is a view from the computer on the datasource that can be placed
between
A datatable is (mostly) the holder of the references to the real data in
your system.

So when you want information about the used data, I think that you than have
to look at the used datatable in my opinion.

Cor


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Obtaining information about DLLs from VBA JAC Microsoft Excel Programming 1 14th Dec 2008 09:52 PM
Obtaining information w/o a query dbby3 Microsoft Access Queries 1 4th Jun 2008 05:31 PM
Obtaining device information =?Utf-8?B?bmV3IHRvIFdpbmRvd3MgTW9iaWxl?= Microsoft Dot NET Compact Framework 1 12th Sep 2007 09:30 PM
Obtaining WPA information tommytwh@gmail.com Windows XP General 2 30th Mar 2006 04:41 PM
Navigating DataGrids: How to access information in Child Tables Gregory Persson Microsoft ADO .NET 1 14th Jul 2003 04:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:43 AM.