how to Fill_Combol()

July 2, 2008

it’s easy… where cblProject is the combol for fill…

public void Fill_Combol()
{
SqlCommand com = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
da.TableMappings.Add(”Table”, “hforms”);
com.Connection = SoftCD.StartForm.MSSqlcon;
com.CommandType = CommandType.Text;
com.CommandText = “select PRID,PR_DESCR from LibProject order by PR_DESCR “;
da.SelectCommand = com;
da.SelectCommand.ExecuteNonQuery();
da.Fill(ds);

cblProject.DataSource = ds.DefaultViewManager;
cblProject.DisplayMember = “hforms.PR_DESCR”;
cblProject.ValueMember = “hforms.PRID”;
}

Entry Filed under: c-sharp. Tags: , , , , , , , , , , , , , , .


Archives

Other

Categories

 

July 2008
M T W T F S S
« Jun   Aug »
 123456
78910111213
14151617181920
21222324252627
28293031  

Tags