hello
this source code have rine time error
plzzzzzzzzzzzzzzzzzz help me
====================================
namespace project1.DAL.Services
{
public class CategoryService
{
public static void AddCategory(Category category)
{
try
{
SqlParameter[] pr = null;
pr = new SqlParameter[1];
pr[1] = new SqlParameter("@c", System.Data.SqlDbType.NVarChar, 20);
pr[1].Value = category.CG;
Data.ExecuteInsertQuery("addcategory", pr);
}
catch
{
throw;
}
}
}
======================================
BAL
categoryBAL
namespace project1.BAL.Controllers
{
public class CategoryBAL
{
public static bool InsertCategory(Category ctg )
{
try
{
CategoryService.AddCategory(ctg);
return true;
}
catch
{
throw;
}
}
}
}
====================================
UI
private void ADDCATEGORY_Click(object sender, EventArgs e)
{
try
{
Comman.Entities.Category c1 = new Comman.Entities.Category();
BAL.Controllers.CategoryBAL.InsertCategory(c1);
bindingSource1.Add(c1);
dataGridView1.DataSource = bindingSource1;
MessageBox.Show("عملیات با موفقیت انجام شد");
this.Close();
}
catch (Exception d)
{
MessageBox.Show(d.Message, "error");
}
}