combo box value will disableYKyesubabu k9yAsked Mar 9, 2017, 11:03 PM814Windows FormsDear Sir invoice no 1 was paid so if paided invoices will not display in combo box how can i do that please help me
Gnanavel Sekar9y agoPosted Mar 10, 2017, 9:42 AMusing (SqlConnection con = new SqlConnection(connectionstring)) { using (SqlCommand cmd = new SqlCommand("SELECT InvoiceId FROM Invoice where status!='Paid'")) { cmd.CommandType = CommandType.Text; cmd.Connection = con; con.Open(); ddlCustomers.DataSource = cmd.ExecuteReader(); ddlCustomers.DisplayMember = "InvoiceId"; ddlCustomers.ValueMember = "InvoiceId"; con.Close(); } }+1
Nilesh Shah9y agoPosted Mar 10, 2017, 9:20 AM@ Gnanavel Sekar The question category is windows forms and we don't have IsPostBack in win forms :)+1
Nilesh Shah9y agoPosted Mar 10, 2017, 12:05 AM:) how r u getting data to display in combobox? this is not windows forms related issue but a basic business rule Just apply the condition that the DB query does not fetch paid invoices+1
Gnanavel SekarPosted Mar 10, 2017, 9:44 AM
Gnanavel SekarPosted Mar 10, 2017, 9:42 AM
Nilesh ShahPosted Mar 10, 2017, 9:20 AM
Nilesh ShahPosted Mar 10, 2017, 12:05 AM