Click here to Skip to main content
15,068,929 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
DAL CODE

C#
public void insertjobdata(string NAME, string DESCRIPTION)
      {
          cmd = new SqlCommand("insertjobdata", con);
          cmd.CommandType=CommandType.StoredProcedure;
          cmd.Parameters.Clear();
          cmd.Parameters.AddWithValue("@NAME",NAME);
          cmd.Parameters.AddWithValue("@DESCRIPTION",DESCRIPTION);
          con.Open();
          cmd.ExecuteNonQuery();
          bind();
          con.Close();


      }

BAL CODE
C#
public void insertjobdata(string NAME, string DESCRIPTION)
   {
       try
       {
           OBJ.insertjobdata(NAME, DESCRIPTION);
       }
       catch (Exception EX)
       { throw EX; }
   }

MAIN CODE
C#
private void Tsb_Create_Click(object sender, EventArgs e)
      {
          if (Txt_Name == null)
          { MessageBox.Show("ENTER DEATILS"); }
          try
          {
              obj.insertjobdata(Txt_Name.Text, Txt_Desc.Text);
              MessageBox.Show("inserted");
          }
          catch (Exception EX)
          { throw EX; }

      }

C#
private void jobControl1_Load(object sender, EventArgs e)
     {
         Dgv_Summary.DataSource = obj.gettabledata();
     }
Posted
Comments
Kumarbs 1-Aug-14 1:44am
   
Is duplicate data available in table too? or only in grid?.
navya chowdary 2-Aug-14 8:04am
   
only in grid view
[no name] 2-Aug-14 22:40pm
   
Please debug and check whether there is duplication in your Data table also. And also please provide code for your stored procedure here( insertjobdata). There may be the problem.

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