protected void cmdAdd2_Click(object sender, EventArgs e) { clsManufacturer DB = new clsManufacturer(); try { if (txtManufacturerId1 == null) //cboitem, lblUnitcost,txtquantity,txtregno,dtdate,txtAmount { lblResults1.Text = "Enter the manufacturer"; } if (txtManufacturerId1.GetType() != typeof(String)) { lblResults1.Text = "Enter the manufacturer"; } if (txtManufacturerName0 == null) { lblResults1.Text = "The Manufacturer cannot be empty"; } if (txtManufacturerName0.GetType() != typeof(string)) { lblResults1.Text = "Enter the Manufacturer"; } string varResponse = DB.Add_rec(txtManufacturerId1.Text, txtManufacturerName0.Text); // Fill the DataSet. DataSet ds = new DataSet(); ds = DB.FindTable(); //adapter.Fill(ds, "tb_Customer"); // Perform the binding. GridView11.DataSource = ds; GridView11.DataBind(); lblResults1.Text = "Operation successful"; return; } catch (FormatException err) { EventLog log = new EventLog(); log.Source = "Milorry Frontend"; log.WriteEntry(err.Message, EventLogEntryType.Error); } }