is there a quick and simple way of saving the items in a listview to file?....i would also want to load them back into a listview so readable formatting is not of concern...
AcE
Printable View
is there a quick and simple way of saving the items in a listview to file?....i would also want to load them back into a listview so readable formatting is not of concern...
AcE
when u say items do u mean rows of data?
if yes then you could save them as a text file, a new line for each row, and with a comma seperating each value, or in a database.
Let me know if you need some code.
yes yes code would be wut im fishing for here....lol....
AcE
I got some C# code here, it saves the listbox contents to a textfile.
Code:private void SaveList()
{
string sTemp;
string sTemp1;
// Get the name the list is supposed to be saved as.
sTemp = "C:\Myfile.txt";
// Loop through and save all items in list.
if(lb.Items.Count > 0)
{
try
{
// Create a StreamWriter object to write to the file.
StreamWriter writer = new StreamWriter(sTemp.ToString(),false);
// Write the information to the file one line at a time.
for(int i = 0; i < lb.Items.Count; i++)
{
sTemp1 = lb.Items[i].ToString();
writer.WriteLine(sTemp1);
}
// Close the StreamWriter object.
writer.Close();
}
catch(System.Exception except)
{
except.Message.ToString());
}
}
i think i can convert this.....will post with result....thx for code...
AcE