|
-
Jun 11th, 2008, 06:43 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] [02/03] Fill DataGrid With Connected Mode (DataReader)
Hello ,
I want to FIll my DataGrid or in other way i want to know how to do it with DataReader ,
i have done it in Asp.Net 1.1 with setting the DataSource to DataReader but dont seem to work on Windows FOrm
& another thing in 2003 doesnt existe the Method load of DataTable
& another thing DataGrid dont have the propiete like DataGridView
DataGridView.rows.add
so how do you do it ?
Thanks
-
Jun 11th, 2008, 07:08 PM
#2
Re: [02/03] Fill DataGrid With Connected Mode (DataReader)
ASP.NET and WinForms are quite different environments. In ASP.NET data-binding requires an object that implements the IEnumerable interface, which a DataReader does. In WinForms data-binding requires an object that implements the IList or IListSource interface, which a DataReader doesn't. In WinForms you will need to load your data into a DataTable, which implements IListSource, and bind that. Follow the Data Access link in my signature for ways to do that.
The DataGridView control was added in .NET 2.0. If you want to use the DataGridView control you'll have to leave VS.NET 2003 behind and upgrade to VS 2005 or 2008. You only have access to the DataGrid control, which does the same job but is less functional.
-
Jun 11th, 2008, 07:19 PM
#3
Thread Starter
Fanatic Member
Re: [02/03] Fill DataGrid With Connected Mode (DataReader)
hi John ,
Yes I Know but I Use now DataGrid & i want to Know how to do it without DataTable or DataSet
something With DataReader ..
with Connected Mode
Can We do it ?
With DataGrid in Vb 2003 ?
Thanks
-
Jun 11th, 2008, 07:26 PM
#4
Re: [02/03] Fill DataGrid With Connected Mode (DataReader)
 Originally Posted by killer7k
hi John ,
Yes I Know but I Use now DataGrid & i want to Know how to do it without DataTable or DataSet
something With DataReader ..
with Connected Mode
Can We do it ?
With DataGrid in Vb 2003 ?
Thanks
Maybe it was my imagination but I was under the impression that I just answered that question. The answer is still "no", just as it was in my last post. Maybe you should go back and read it again. Maybe properly this time.
-
Jun 11th, 2008, 07:27 PM
#5
Thread Starter
Fanatic Member
Re: [02/03] Fill DataGrid With Connected Mode (DataReader)
Thanks John for Those Info !
-
Jun 11th, 2008, 07:30 PM
#6
Re: [RESOLVED] [02/03] Fill DataGrid With Connected Mode (DataReader)
You should also be aware that there's nothing "connected" about data-binding in ASP.NET. The reason that you can use an IEnumerable object in data-binding in ASP.NET is because all that ASP.NET can do is loop through the data and insert it into the HTML code of the page. Once that HTML is served to the client the DataReader has already been closed. There's no connection between the client and the database and there's no communication between the UI and the data source.
In WinForms data-binding requires an IList object because as you navigate and edit the data in the UI those changes are pushed directly to the data source. An IEnumerable object cannot provide that functionality so an IList is required.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|