public void CategoryDDLDataBind() { try { //string s = "04/10/2018"; SqlConnection cn = new SqlConnection(ConnectionString); SqlCommand cmd = new SqlCommand(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds1 = new DataSet(); cn.Open(); cmd.CommandText = "Select ID, Customer_Name,Customer_Mobile,Arrival_Date,Time_Slot, Table_Number from Bookingdetails where Arrival_Date='" + TextBox1.Text + "' and Status='" + "1" + "'"; cmd.Connection = cn; da = new SqlDataAdapter(cmd); da.Fill(ds1); cmd.ExecuteNonQuery(); DataList2.Dispose(); DataList2.DataSource = ds1; DataList2.DataBind(); cn.Close(); } catch { // lbtotalRow.Text = "No Records Found"; } }
//Category Bind on dropdown list public void CategoryDDLDataBind() { try { SqlConnection cn = new SqlConnection(ConnectionString); SqlCommand cmd = new SqlCommand(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds1 = new DataSet(); cn.Open(); cmd.CommandText = "Select ItemCategory from tbl_Category where ShopID='" + Label11.Text + "'"; cmd.Connection = cn; da = new SqlDataAdapter(cmd); da.Fill(ds1); cmd.ExecuteNonQuery(); DataList2.Dispose(); DataList2.DataSource = ds1; DataList2.DataBind(); cn.Close(); } catch { // lbtotalRow.Text = "No Records Found"; } }
public void CategoryDDLDataBind() { try { SqlConnection cn = new SqlConnection(ConnectionString); SqlCommand cmd = new SqlCommand(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds1 = new DataSet(); cn.Open(); cmd.CommandText = "Select CompanyName from tbl_settings where AccountNumber='" + accountnumber + "'"; cmd.Connection = cn; da = new SqlDataAdapter(cmd); da.Fill(ds1); cmd.ExecuteNonQuery(); DataList2.Dispose(); DataList2.DataSource = ds1; DataList2.DataBind(); cn.Close(); } catch { // lbtotalRow.Text = "No Records Found"; } }