ListView Control how to add data to the second column

liunx

Guest
Hi, I am trying to build a listview with two columns. One will contain files that don't exist and the second files that exist. I can't add to the second column the data. Anyone knows how to do it? Here is the code snippet: lvFiles is the name of the listview. I need to show the files that exist in the second column. The files that don't exist actually appear the statement: lvFiles.Items.Add((String)dtrFileName["location_url"]); adds it. Thanks.


OleDbDataReader dtrFileName;
dtrFileName = dbComm.ExecuteReader();
int counterE = 0;
int counterNE = 0;

//Read from the database the file names specified in the query
while(dtrFileName.Read())

if(File.Exists("C:\\inetpub\\wwwroot\\Documents\\" +(String)dtrFileName["location_url"]))
{
counterE++;
}
else
{
counterNE++;
label3.Text+=label3.Text ="C:\\inetpub\\wwwroot\\Documents\\"+ dtrFileName["location_URL"] +" don't exist \n";
lvFiles.Items.Add((String)dtrFileName["location_url"]);
}
 
Back
Top