This is a discussion on Create database object with dynamically within the C# Programming forums, part of the Software Development category; Hi all, I'm going to populate a datagrid with some data. The data will be from an object that ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi all, I'm going to populate a datagrid with some data. The data will be from an object that populated by a query. So I pull data from my database, but now Im having trouble wondering how I can get data from my database into the data grid! Would anyone be able to help me as im kind of stuck.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| Sponsored Links |
| |||
| Yes, It has a Read() Method, which i can run through each row in the resultset. I just have no idea how to populate an object, based on the current field. ![]()
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| You should be able to loop and retrieve the data using something such as: Code: while(theObject.Read())
{
Response.Write(theObject["ColumnName"]);
} However, if you don't plan to use the DataGrid specific features, you're better of using a Table object (typical HTML table) and create new rows. It should be easier.
__________________ cheers Aman |
| |||
| I decided in the end to use a library i made called Dynamic Object, it allows me too generate members for objects dynamically and then later pull them out of the object using a foreach loop without ever knowing the member names. Only problem is the object doesnt actually exist, so it would be impossible to apply methods too the objects, enless the contrainer object extended from a code based object ... Thanks for the help!
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how can i create serialized object in PHP? | saravanan | PHP Programming | 1 | 03-24-2008 06:52 PM |
| How Create print preview page dynamically in ASP.NET | KiruthikaSambandam | ASP and ASP.NET Programming | 4 | 03-21-2008 04:42 AM |
| How can we Dynamically create web controls | Kirubhananth | ASP and ASP.NET Programming | 3 | 03-14-2008 10:00 PM |
| Code-behind to create node dynamically using XML File or any Stored Procedure | poornima | ASP and ASP.NET Programming | 3 | 02-14-2008 09:46 PM |
| How to create xml dom object and how to use its fucntions in php | itbarota | PHP Programming | 1 | 07-26-2007 12:10 AM |