namespace FitoStore
{
public partial class FitoStore : Form
{
private Dyqan dyqan = new Dyqan();
public FitoStore()
{
InitializeComponent();
SetupData();
}
private void SetupData()
{
dyqan.Shitesit.Add(new Shites { Emeri = "Kujtim", Mbiemeri = "Arishta" });
dyqan.Shitesit.Add(new Shites { Emeri = "Zaim", Mbiemeri = "Sherbela" });
dyqan.Produkte.Add(new Produkt {Lloji = "Dap",Kilogram ="25",Cmimi="2.500"});
dyqan.Produkte.Add(new Produkt {Lloji = "Nitrat",Kilogram="50",Cmimi="2.500"});
}
}
}
Asked
Active
Viewed 1,297 times
0

NikolaiDante
- 18,469
- 14
- 77
- 117

elvira arishta
- 13
- 5
-
1Use `decimal.Parse("25")` or simply `Kilogram = 25` – Tim Schmelter Jan 29 '16 at 16:49
-
1If your `Kilogram` field is of type decimal, then instead of assigning it a string `"25"` , assign it `25M`, where `M` specifies a number as decimal, or simply `25`. – Habib Jan 29 '16 at 16:51
-
not work @TimSchmelter – elvira arishta Jan 29 '16 at 16:51
-
Still is the same error@Habib – elvira arishta Jan 29 '16 at 16:53
1 Answers
0
Try
dyqan.Shitesit.Add(new Shites { Emeri = "Kujtim", Mbiemeri = "Arishta" });
dyqan.Shitesit.Add(new Shites { Emeri = "Zaim", Mbiemeri = "Sherbela" });
dyqan.Produkte.Add(new Produkt {Lloji = "Dap",Kilogram =25M,Cmimi=2.500M});
dyqan.Produkte.Add(new Produkt {Lloji = "Nitrat",Kilogram=50M,Cmimi=2.500M});
Where 25M means a decimal of value 25.
I've also done it to Cmimi
as that looks like it should be a decimal. You may need to change it back depending on the type there.

Community
- 1
- 1

NikolaiDante
- 18,469
- 14
- 77
- 117
-
No problem, don't forget to [mark this as accepted](http://stackoverflow.com/help/accepted-answer) if this is the solution to your problem. :-) – NikolaiDante Jan 29 '16 at 16:57