|
-
May 17th, 2005, 09:16 AM
#1
Thread Starter
Hyperactive Member
Cannot Get Datagrid to Bind to Dataset
Hi all,
I'm having a real hard time getting data from an Access database to be displayed in a datagrid in a webform.
Here is my code:
VB Code:
DataGrid1.DataSource = DS.Tables(0).DefaultView
DataGrid1.DataBind()
MyDataAdapter.Dispose()
MyConnection.Dispose()
I've tried not calling the .Dispose methods at the end, but doesn't make a difference.
I know this shouldn't be hard, but for some reason, it's not working.
Prior to this code, I do a response.write (ds.tables(0).Rows.Count) and I get > 0, so it's getting something.
Does anyone have any suggestions?
Thanks in advance.
JB
JazzBass
In the .NET era
Trying to remember VB6
Progress: 
XP Professional @ Home
and @ the Office
-
May 18th, 2005, 08:27 AM
#2
Addicted Member
Re: Cannot Get Datagrid to Bind to Dataset
Hello
I'm programming ASP.net since a few weeks, so I'm new.. But why not use the SqlDataSource? It works fine for me..
You bound the SqlDataSource to the gridview..
You can edit the query that fills the SqlDataSource whenever you want..
greetz
nickname
Software Engineer
DBA
Webdesigner
--
to code or to be coded, that's the question
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
|