Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Re: Populate a listview with a dataset.


Message #1 by "Ian Bennett" <ian.bennett@a...> on Wed, 4 Sep 2002 06:19:51
Jonas,
I think you might try the following
	using System.Data.OleDb;

	OleDbConnection dbConn = new OleDbConnection();
	OleDbCommand dbCmd = new OleDbCommand();
	dbConn.ConnectionString = sConn;
	dbConn.Open();
//need a select string here
	dbLocalCmd.CommandText=sSQL;
	dbCmd.Connection = dbConn;

This gets away from a fixed dataset control.
With the resulting 
	OleDbDataReader rsLocal = dbLocalCmd.ExecuteReader();
	while (rsLocal.Read())
you can then add the rsLocal items to the listview.
including the headers etc




  Return to Index