Paging with Datagrid Control

E

Elton W

Hi Joey,

First of all, when performing paging we need rebind
datagrid's data source. But the data source could be a
dataset, or datatable, or some other data collection.

Secondly, dataset can be filled by either SqlDataAdapter
or OleDbDataAdapter from database (, or even by reading
XML file). You don't have to use SqlDataAdapter.

Hence in your case, you can use OleDbDataAdapter to pull
data from access database:

OleDbDataAdapter dap = new OleDbDataAdapter(Select_Query,
Connection_String) ;
DataTable table = new DataTable();
Dap.Fill(table);
DataGrid.DataSource = table;

BTW, please take look following URL:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cpguide/html/cpconoverviewofadonet.asp

HTH

Elton Wang
(e-mail address removed)
 
E

Elton W

Hi Joey,

1) Connection String:
For Access, it's like:
"Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\bin\LocalAccess40.mdb"

2) You are using Request("DeptID"). Suppose you want to
get it from query string, it's better to use
Request.QueryString.Get("DeptID"). Or if it's from HTML
form textbox, use
Request.Form.Get("DeptID")

HTH

Elton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top