Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hello
this source code have rine time error
plzzzzzzzzzzzzzzzzzz help me
====================================
C#
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
C#
namespace project1.BAL.Controllers
{
  public  class CategoryBAL
    {
      public  static bool InsertCategory(Category ctg  )
      {

          try
          {
              CategoryService.AddCategory(ctg);

              return true;
          }
          catch
          {

              throw;
          }
      }
    }
}


====================================
UI
C#
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");
           }

       }
Posted
Comments
ZurdoDev 9-Jul-15 12:43pm    
If you want help, then plzzzzzzzzzzzzzzzzzz provide the error so we don't have to guess which one of the 1,432,432 possible errors you are seeing.

how do i delete this post???i don not know how delete this post
 
Share this answer
 
sorry i don't know how delete this post
i have recently joined to code project
plzz help me celebrate teachers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900