Mycon. The Open ();
SqlDataAdapter sda=new SqlDataAdapter (" select * from ShenNai ", mycon);
The DataTable table=new DataTable ();
Sda. The Fill (table);
ComboBox1. The DataSource=table;
for (int i=0; I & lt; 242; I++)
{
String XSMC.=the table Rows [MainInterface inheritannum] [I + 8]. The ToString ();
ComboBox1. Items. The Add (XSMC);
}
I write so, after the operation shows the five system. Data. Datarowview, I see online combobox is shows the column data, cannot display line data? Only one by one manually to knock?
CodePudding user response:
Can the SQL transfer data rowCodePudding user response:
This.com boBox1. The DataSource=table;//set the ComboBox dataThis.com boBox1. DisplayMember=;//let the ComboBox display column
This.com boBox1. ValueMember=;//let the ComboBox practical value for the column