GridView Not Returning Data

M

Mike

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
 
E

Elmo Watson

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)
 
M

Mike

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
 
M

Mike

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
 

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,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top