c# - Having Problems populating my checkedListBox -


So what's happening here when I press the event button1 to get data from my database I find it from System.Data.DataRowView . But when I press the button1 event then it shows the actual result and the correct data. I want to know how to fix this in a click of a button to display the actual data.

  Private Zero Button 1_Click (Object Sender, EventArgs e) {SqlConnection con = new SqlConnection (@ "SQLCONNECTIONSTRING"); Con.Open (); SqlCommand CMD = New SQL Commands ("Choose * to tbl_members", Con?); SqlDataAdapter Adapter = New SqlDataAdapter (CMD); SqlDataReader Reader = cmd.ExecuteReader (); Datatable dt = new datatable (); Dt.Columns.Add ("full name", typef (string)); Dt.load (reader); Dataset ds = new dataset (); Adapter.fill (ds); Checklist Button 1 Displaymilk = "full name"; Checklist Button 1 Value = "full name"; Checklistbox 1 Data source = databables [0]; CheckedListBox1.Enabled = true; CheckedListBox1.Refresh (); Con.Close (); }  

The order of assignments should not be different?

  checked listbox 1 Data source = databables [0]; Checklist Button 1 Displaymilk = "full name"; Checklist Button 1 Value = "full name"; Instead of  

  checklist button 1. Displaymilk = "full name"; Checklist Button 1 Value = "full name"; Checklistbox 1 Data source = databables [0];  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -