I am doing a winforms applications, that identify vehicle.
In this application, I will use a identification code that correspond to a vehicle.
It is simple, i only have one code for all cars for a year, and one code for bike in a year.
So, I was thinking about this kind of datas ::
year | car code | bike code
2014 | 156 | 185
2015 | 158 | 189
I have a subform, that will show all this data into a listbox(or another list type), and also, allow me to add a line. When I will add a line, I will be displayed in the list, and will be add into the file.
And in another view, I will displays all the 'year' part into a combo box.
What I want to know is , what is the best way to store my data into a file (csv, xml, or others...) so that I can read and edit easily this file, and displays the datas into a
I know how to do with a database, but without, I never done it, and don't find anything that can help me.
I hope I'm clear, if not, tell me.
edit :
public FormPref()
{
lst = GetIdentifiant(path);
dataGridViewIdentifiant.DataSource = lst;
}
private void buttonAddIdentifiant_Click(object sender, EventArgs e)
{
Vehicule identifiant = new Vehicule();
if (!string.IsNullOrEmpty(textBoxYear .Text) &&
!string.IsNullOrEmpty(textBoxCarCode .Text) &&
!string.IsNullOrEmpty(textBoxBikeCode .Text))
{
identifiant.Year = textBoxYear .Text;
identifiant.CarCode = textBoxCarCode .Text;
identifiant.BikeCode = textBoxBikeCode .Text;
lst.Add(identifiant);
}
}
I tried update the display in the datagridview with refresh, update, but nothing works.
The datagridview is bind with the value of the class.
Thank you.