objectdatasource, dataset,dataadapter

D

davefromalbury

I have a gridview connected to a objectdatasource. Can't for the life
of me get it to display anything though, always appears empty. The
dataset always seems to be filled with records, as the variable "x"
always equals the number of records i expected. The business object
select command:

public static DataSet Select()
{
DataSet dataSet = new DataSet();
SqlDataAdapter dataAdapter = new SqlDataAdapter();
dataAdapter.SelectCommand=new SqlCommand( "SELECT
category,id FROM categories");
dataAdapter.SelectCommand.Connection = new
SqlConnection(ConfigurationManager.ConnectionStrings["IssueTrackerConnectionString"].ConnectionString);


dataAdapter.SelectCommand.CommandType = CommandType.Text;

int x = dataAdapter.Fill(dataSet);
return dataSet;
}

CANNOT figure out what's happening. Any ideas?

Cheers
dave
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top