Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GridView Not Returning Data

12 views
Skip to first unread message

Mike

unread,
Jan 10, 2007, 4:33:27 PM1/10/07
to
I'm using the 2.0 framework and cannot get a gridview to return records
with an objectDataSource.
I can preview the data from the datatable.
To make this as simple as possible I used the wizard and turned all
paging and sorting options off and the gridview will not display
anything. Not even column headings. I have a text box, drop down list,
button and a label on the page and they all display fine.
Why won't the gridview do it's job?

Thanks
Mike

Elmo Watson

unread,
Jan 10, 2007, 5:15:10 PM1/10/07
to
We'll probably need more info....first - are you creating a Dataset - and
the data you can preview is buy using that with the objectDatasource?

Also - have you remembered to tie the ObjectDataSource to the Gridview?

Also - when you try running the query in the database, does it return data?
(just hitting the first things I can think of)
--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"Mike" <mck...@gmail.com> wrote in message
news:1168464807....@o58g2000hsb.googlegroups.com...

Mike

unread,
Jan 11, 2007, 8:54:06 AM1/11/07
to
are you creating a Dataset
Yes, I created a dataset and pulled a stored procedure over that
does a simple select statement.

the data you can preview is buy using that with the objectDatasource?

Again yes, I can preview the data using the objectdatasource.

have you remembered to tie the ObjectDataSource to the Gridview?

I tried doing this in code and also using a wizard

when you try running the query in the database, does it return data?

when I call the stored procedure from query analyzer I get a result
set.

All the stored procedures in SQL Server have been tested and work.

The data layer is most of the way completed. Now I can't get something
that should be simple to work. Tried using all the wizards just to see
if there was something I was missing but nothing is working.

I'm using Visual Web Developer 2005 Express Edition.

Thanks
Mike

Mike

unread,
Jan 11, 2007, 10:03:13 AM1/11/07
to
Figured out the problem. Has to do with the input parameters. For some
reason you can preview the data from the dataset with empty strings but
when creating a datasource (either Sql or Object) you have to supply a
value for all input parameters. I even change the setting for
ConvertEmptyStringToNull to False and that still didn't work.
I have no idea why this is the case. I guess the way around this is to
use the % as the default value.

Anyone else know why this is the case?

Thanks again
Mike

0 new messages