PDA

View Full Version : Accounting2.BOL.Sanad' does not contain a constructor that takes '0' arguments - برنامه نویسی 3 لایه



shima2006
یک شنبه 14 آذر 1389, 13:32 عصر
سلام دوستان
بعد از کلی مشقت بالاخره یک برنامه کوچولو به صورت سه لایه نوشتم ... به نظر خودم که درسته:لبخند: ولی نمیدونم چرا خطا داره!



private void button1_Click(object sender, EventArgs e)
{
try
{
BOL.Sanad san = new BOL.Sanad();
san.Accountid = Convert.ToInt32(idtxt.Text);
san.Title = titletxt.Text;
san.Owe =Convert.ToDecimal(owetxt.Text);
san.Creditor =Convert.ToDecimal(creditortxt.Text);
san.Add();
}




Error 1 'Accounting2.BOL.Sanad' does not contain a constructor that takes '0' arguments

M.YasPro
یک شنبه 14 آذر 1389, 13:47 عصر
قکر میکنم این سوال قبلا پرسیده شده .
متد سازنده کلاس Sanad در لایه BOL شامل 0 پارامتره ، در صورتی که این متد سازنده اوورلودی با 0 پارامتر نداره .

shima2006
یک شنبه 14 آذر 1389, 14:01 عصر
متشکرم دوست عزیز
با این تغییر درست شد


BOL.Sanad san = new BOL.Sanad(Convert.ToInt32(idtxt.Text),titletxt.Tex t
,Convert.ToDecimal(owetxt.Text),Convert.ToDecimal( creditortxt.Text));