467,915 Members | 1,643 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

Datagrid binding

Hi all,

It may be a very simple query, but i am stuck with having
millions of record showing instantly in chunks of 100 or
200 record(not a paging concept), in vb i use to bind the
data to ado datacontrol which is binded to datagrid and
data is instantly shown using ado events and methods in a
user friendly manner i.e data is shown and fetched
simultaneously.

In vb.net if i am using dataset and binding that dataset
to grid, the data is not shown till all the records are
fetched and i don't know how to bind it to datareader,
also i don't know how to use threads to achieve this, can
anyone help me out with some piece of code to get me
started.

Thanks,
Ashwani.
Nov 20 '05 #1
  • viewed: 2769
Share:
5 Replies
Cor
Hi Ashwani,

Making a dataset of all your records is in my opinion not the right way,
You can make smaller tables using by instance in the select clause the
"Where"

One of the posibilities is let the user first select it using a combobox
where you only did fill a dataset with the showmember and the keyfields from
a parent database table

Just a thought, but there are of course thousands of other ways.

I don't think that using the datareader will help you much further, you have
to do a lot of work yourself
- making the dataset
- making the datatable
- making the columns
- creating the keys
- read all rows
- filling item by item all the rows
- add the rows to the table
and all I forget.
And then I think the result will be the same.

If you don't know how to create a dataset with a fill, that is roughly
written as pseudo
\\\
dim mydataset as new dataset
(connection, dataadapter, and commandbuilder need a prefix as Oledb or SQL)
dim myconnection as new connection("connectionstring")
dim mydataadapter as new dataAdapter("MySQLWhereString",myconnection)
mydatadapter.fill(mydataset)
///

I hope this helps

Cor

It may be a very simple query, but i am stuck with having
millions of record showing instantly in chunks of 100 or
200 record(not a paging concept), in vb i use to bind the
data to ado datacontrol which is binded to datagrid and
data is instantly shown using ado events and methods in a
user friendly manner i.e data is shown and fetched
simultaneously.

In vb.net if i am using dataset and binding that dataset
to grid, the data is not shown till all the records are
fetched and i don't know how to bind it to datareader,
also i don't know how to use threads to achieve this, can
anyone help me out with some piece of code to get me
started.

Nov 20 '05 #2
Hi,

http://www.dotnet247.com/247reference/msgs/5/27771.aspx

Ken
---------------
"Ashwani Gaur" <ga**********@netsity.com> wrote in message
news:03****************************@phx.gbl...
Hi all,

It may be a very simple query, but i am stuck with having
millions of record showing instantly in chunks of 100 or
200 record(not a paging concept), in vb i use to bind the
data to ado datacontrol which is binded to datagrid and
data is instantly shown using ado events and methods in a
user friendly manner i.e data is shown and fetched
simultaneously.

In vb.net if i am using dataset and binding that dataset
to grid, the data is not shown till all the records are
fetched and i don't know how to bind it to datareader,
also i don't know how to use threads to achieve this, can
anyone help me out with some piece of code to get me
started.

Thanks,
Ashwani.

Nov 20 '05 #3
Hi Cor,

Thanks for your reply, paging option you suggested is my
last option, i want my application to be user friendly
then processor friendly, i.e. when user presses some
button suppose Load Data, the grid starts filling with
data, that data could either come from dataset or
datareader and simultaneouly user will be able to see the
progress of data fetch by means of some message or so that
this many record have been fetched, user may also be able
to stop the fetch when some particular amount of data have
been fetched.

Any Help.

Thanks,
Ashwani.
-----Original Message-----
Hi Ashwani,

Making a dataset of all your records is in my opinion not the right way,You can make smaller tables using by instance in the select clause the"Where"

One of the posibilities is let the user first select it using a comboboxwhere you only did fill a dataset with the showmember and the keyfields froma parent database table

Just a thought, but there are of course thousands of other ways.
I don't think that using the datareader will help you much further, you haveto do a lot of work yourself
- making the dataset
- making the datatable
- making the columns
- creating the keys
- read all rows
- filling item by item all the rows
- add the rows to the table
and all I forget.
And then I think the result will be the same.

If you don't know how to create a dataset with a fill, that is roughlywritten as pseudo
\\\
dim mydataset as new dataset
(connection, dataadapter, and commandbuilder need a prefix as Oledb or SQL)dim myconnection as new connection("connectionstring")
dim mydataadapter as new dataAdapter ("MySQLWhereString",myconnection)mydatadapter.fill(mydataset)
///

I hope this helps

Cor

It may be a very simple query, but i am stuck with having millions of record showing instantly in chunks of 100 or
200 record(not a paging concept), in vb i use to bind the data to ado datacontrol which is binded to datagrid and
data is instantly shown using ado events and methods in a user friendly manner i.e data is shown and fetched
simultaneously.

In vb.net if i am using dataset and binding that dataset
to grid, the data is not shown till all the records are
fetched and i don't know how to bind it to datareader,
also i don't know how to use threads to achieve this, can anyone help me out with some piece of code to get me
started.

.

Nov 20 '05 #4
Cor
Hi Ken,

Are you sure of that link you gave?

There are 2 answers,
One gives 2 lines of how to make a dataset from a reader while I did give
almost all so that was not the meaning of your message.

The other binds a datareader to a datagrid.datasource, while the
documentation say it has to be a iList

What do I see wrong?

Cor
http://www.dotnet247.com/247reference/msgs/5/27771.aspx

Nov 20 '05 #5
Hi,

Your right. I tried the bottom it does not work. I should have
checked it first.

Ken
----------------
"Cor" <no*@non.com> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Hi Ken,

Are you sure of that link you gave?

There are 2 answers,
One gives 2 lines of how to make a dataset from a reader while I did give
almost all so that was not the meaning of your message.

The other binds a datareader to a datagrid.datasource, while the
documentation say it has to be a iList

What do I see wrong?

Cor
http://www.dotnet247.com/247reference/msgs/5/27771.aspx


Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Shivang | last post: by
reply views Thread by Tom Hughes | last post: by
5 posts views Thread by Jeff | last post: by
4 posts views Thread by Steve B. | last post: by
3 posts views Thread by vinayak | last post: by
5 posts views Thread by Brad Shook | last post: by
2 posts views Thread by =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.