'IListSource does not contain any data sources'

Discussion in 'ASP .Net' started by peter@yahoo.not, Jan 12, 2005.

  1. Guest

    Hi,

    I try to bind a DataTable to a DataGrid, but I receive
    the following error-message :
    'The IListSource does not contain any data sources'.

    I have no clue what the problem might be, as I can tell that
    the DataTable actually contains valid data. This is the code :


    DataTable dtUserlist = new CoreTasks().selectUsers();

    showContent(dtUserlist); // Proves that the DataTable contains data.

    dgTasks.DataSource = dtUserlist;
    dgTasks.DataBind(); // Error on this line.

    I have already searched a lot on this, but to no avail.
    Who can point me in the right direction ?
    , Jan 12, 2005
    #1
    1. Advertising

  2. Marina Guest

    Do you have any code that happens on databinding, etc.

    Does this work on just a plain grid with nothing customized?

    <> wrote in message
    news:...
    > Hi,
    >
    > I try to bind a DataTable to a DataGrid, but I receive
    > the following error-message :
    > 'The IListSource does not contain any data sources'.
    >
    > I have no clue what the problem might be, as I can tell that
    > the DataTable actually contains valid data. This is the code :
    >
    >
    > DataTable dtUserlist = new CoreTasks().selectUsers();
    >
    > showContent(dtUserlist); // Proves that the DataTable contains data.
    >
    > dgTasks.DataSource = dtUserlist;
    > dgTasks.DataBind(); // Error on this line.
    >
    > I have already searched a lot on this, but to no avail.
    > Who can point me in the right direction ?
    Marina, Jan 12, 2005
    #2
    1. Advertising

  3. Guest

    >> I try to bind a DataTable to a DataGrid, but I receive
    >> the following error-message :
    >> 'The IListSource does not contain any data sources'.
    >>
    >> I have no clue what the problem might be, as I can tell that
    >> the DataTable actually contains valid data. This is the code :
    >>
    >>
    >> DataTable dtUserlist = new CoreTasks().selectUsers();
    >>
    >> showContent(dtUserlist); // Proves that the DataTable contains data.
    >>
    >> dgTasks.DataSource = dtUserlist;
    >> dgTasks.DataBind(); // Error on this line.
    >>
    >> I have already searched a lot on this, but to no avail.
    >> Who can point me in the right direction ?



    >Does this work on just a plain grid with nothing customized?


    I will try that.


    > Do you have any code that happens on databinding, etc.


    I don't understand what you mean by that. As you can see in my code
    snippet, I have a class which provides a filled DataTable, just before
    I try to bind it.

    The test-method 'showContent(dtUserlist)' proves that the DataTable
    really contains data, so how could the data-binding possible fail ?

    I have several other similair DataGrids in my project, they all work fine.
    The only difference here is, that this DataGrid is in a modal dialog. But it
    has worked before. I think the problem has started when I moved the
    code which fills the table to its own class.
    But (and I start to repeat myself :), the DataTable really contains
    data, so how on earth could the data-binding possible fail ?

    Peter.
    , Jan 13, 2005
    #3
    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. troutbum
    Replies:
    1
    Views:
    4,649
    =?Utf-8?B?S2VuIENveCBbTWljcm9zb2Z0IE1WUF0=?=
    Oct 6, 2004
  2. Assimalyst
    Replies:
    10
    Views:
    3,657
    Assimalyst
    Jul 8, 2005
  3. Mike P
    Replies:
    0
    Views:
    358
    Mike P
    Jan 31, 2007
  4. =?Utf-8?B?V2FsaWQ=?=

    The IListSource does not contain any data sources.

    =?Utf-8?B?V2FsaWQ=?=, Sep 13, 2007, in forum: ASP .Net
    Replies:
    10
    Views:
    1,156
  5. KK
    Replies:
    1
    Views:
    285
    Srimathi
    Jan 13, 2005
Loading...

Share This Page