You have mixed several things!
1. Move
arka_data
into separate file
2. Find Program.cs file and add this line:
public static List<arka_data> dta;
3. In Form1 constructor:
public Form1()
{
InitializeComponent();
Program.dta = new List<arka_data>();
}
4. Somewhere after... fill in your dta list.
public void mbushe()
{
for (int i = 0; i < dataTable.Rows.Count; i++)
{
arka_data ad = new arka_data();
ad.NR = int.Parse(txtnrfatures.Text);
ad.VLERATVSHTOTAL = float.Parse( textBox1.Text);
ad.BARKODI = int.Parse(dataTable.Rows[i][0].ToString());
ad.EMERTIMI = dataTable.Rows[i][1].ToString();
ad.SASIA = int.Parse(dataTable.Rows[i][2].ToString());
ad.CMIMI = int.Parse(dataTable.Rows[i][3].ToString());
ad.TVSH = int.Parse(dataTable.Rows[i][4].ToString());
ad.NENTOTALI = float.Parse(txttotali.Text);
ad.ZBRITJA = float.Parse(txtzbritja.Text);
ad.TOTALI = float.Parse(totali.Text);
ad.KOHA = DateTime.Now;
ad.KASIERI = lbluser.Text;
ad.KLIENTI = cmbklienti.Text;
ad.VLERAETVSH = float.Parse(dataTable.Rows[i][7].ToString());
ad.VLERAPATVSH = float.Parse(dataTable.Rows[i][6].ToString());
ad.NRATIKUJVE = int.Parse(lblnumri.Text);
ad.TOTALIPCS = float.Parse(dataTable.Rows[i][5].ToString());
Program.dta.Add(ad);
}
4. If you would like to edit single record in Form2, you have to create constructor which accepts
arka_data
class as a parameter. See solution #2 by
OriginalGriff.