public void cupboardself() { SqlDataAdapter da = new SqlDataAdapter("add_book_proc", con); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Parameters.AddWithValue("@action", "cupboardself"); da.SelectCommand.Parameters.AddWithValue("@book_id", ""); da.SelectCommand.Parameters.AddWithValue("@book_name", ""); da.SelectCommand.Parameters.AddWithValue("@book_category", ""); da.SelectCommand.Parameters.AddWithValue("@subtitle", ""); da.SelectCommand.Parameters.AddWithValue("@isbn_no", ""); da.SelectCommand.Parameters.AddWithValue("@author", ""); da.SelectCommand.Parameters.AddWithValue("@cupboard", Cupboard_ddl.SelectedItem.ToString()); da.SelectCommand.Parameters.AddWithValue("@cupboard_self", ""); da.SelectCommand.Parameters.AddWithValue("@edition", ""); da.SelectCommand.Parameters.AddWithValue("@publisher", ""); da.SelectCommand.Parameters.AddWithValue("@book_cost", ""); da.SelectCommand.Parameters.AddWithValue("@book_vendor", ""); da.SelectCommand.Parameters.AddWithValue("@copy", ""); da.SelectCommand.Parameters.AddWithValue("@Remarks", ""); da.SelectCommand.Parameters.AddWithValue("@ASN_no", ""); DataTable dt = new DataTable(); da.Fill(dt); Cupboard_self.DataSource = dt; Cupboard_self.DataTextField = "name"; Cupboard_self.DataValueField = "pk_id"; Cupboard_self.DataBind(); Cupboard_self.Items.Insert(0, "Select Cupboardself"); }
public void cupboardself() { SqlDataAdapter da = new SqlDataAdapter("select * from cupboardself where cupboard='" + Cupboard_ddl.SelectedItem.ToString() + "'", con); DataTable dt = new DataTable(); da.Fill(dt); Cupboard_self.DataSource = dt; Cupboard_self.DataTextField = "name"; Cupboard_self.DataValueField = "pk_id"; Cupboard_self.DataBind(); Cupboard_self.Items.Insert(0, "Select Cupboardself"); }