System.Data.DataRowView problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to fill a datalist with table names from an Oracle database. The
program works fine using the following code:


private void GetTables()
{
// open a database connection
string con = connectLabel.Text;
cn = new System.Data.OleDb.OleDbConnection(con);
cn.Open();

//Declare a DataTable Object
System.Data.DataTable dt ;

//Query for getting the list of all tables from the schema , no restriction
dt = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);


//Display the tables in the tablesList
tablesList.DataSource = dt;
tablesList.DataBind();
}

However, the datalist displays System.data.DataRowView in the datalist when
I run the program. What do I need to change in the above code to fix this
problem.

Thanks,

Dave
 
Are you setting the DataList.ValueMember and DataList.DisplayMember
properties? If you don't do that, I think it defaults to the Type name
of whatever object is assigned to the list.
 
Back
Top