objectdatasource, dataset,dataadapter

Discussion in 'ASP .Net' started by davefromalbury, Feb 6, 2006.

  1. 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
    davefromalbury, Feb 6, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Galen Harris

    dataadapter.update -- dataset from session

    Galen Harris, Oct 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    534
    Jacob Yang [MSFT]
    Oct 24, 2003
  2. Galen Harris
    Replies:
    1
    Views:
    458
    Patrik Löwendahl
    Oct 24, 2003
  3. Amadelle
    Replies:
    1
    Views:
    357
    John Saunders
    Jun 5, 2004
  4. =?Utf-8?B?Qm9vbmFhcA==?=

    typed dataset - dataAdapter - parameter question

    =?Utf-8?B?Qm9vbmFhcA==?=, Jun 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    583
    =?Utf-8?B?Qm9vbmFhcA==?=
    Jun 23, 2005
  5. Rui Dias

    Problems with dataset and dataadapter

    Rui Dias, Aug 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    488
    Rui Dias
    Aug 19, 2005
Loading...

Share This Page