Guest User

Untitled

a guest
Jul 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <ComboBox Height="23" HorizontalAlignment="Right" Margin="0,43,140,0" Name="comboBox2" VerticalAlignment="Top" Width="169" IsEditable="True" IsTextSearchEnabled="True"/>
  2.  
  3. public void BindMedicalStoreComboBox(ComboBox comboBox1)
  4. {
  5. SqlDataAdapter da = new SqlDataAdapter("Select medical_store_id,m_store_name FROM medical_store", con);
  6. DataSet ds = new DataSet();
  7. da.Fill(ds, "medical_store");
  8. comboBox2.ItemsSource = ds.Tables[0].DefaultView;
  9. comboBox2.DisplayMemberPath = ds.Tables[0].Columns["m_store_name"].ToString();
  10. comboBox2.SelectedValuePath = ds.Tables[0].Columns["medical_store_id"].ToString();
  11.  
  12. }
Add Comment
Please, Sign In to add comment