Databinding gives "System.Data.DataRowView" instead of actual values

Posted by iTayb on Stack Overflow See other posts from Stack Overflow or by iTayb
Published on 2010-04-15T22:05:45Z Indexed on 2010/04/15 22:13 UTC
Read the original article Hit count: 463

Filed under:
|
|

This is my code: string SQL = "SELECT email FROM members WHERE subscribe=true"; string myConnString = Application["ConnectionString"].ToString();

        OleDbConnection myConnection = new OleDbConnection(myConnString);
        OleDbCommand myCommand = new OleDbCommand(SQL, myConnection);
        myConnection.Open();
        OleDbDataAdapter MyAdapter = new OleDbDataAdapter(myCommand);
        DataSet ds = new DataSet();
        MyAdapter.Fill(ds);

        MailsListBox.DataSource = ds;
        MailsListBox.DataBind();

        GridView1.DataSource = ds;
        GridView1.DataBind();

        myConnection.Close();

And so it looks: alt text

As you see, the GridView shows the dataset just fine, and the ListBox fails it. What happened? How can I fix it?

Thank you very much.

© Stack Overflow or respective owner

Related posts about c#

Related posts about databinding