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: .net 1.1, .net 2.0, .net 3.0, ADO.NET, c#, c-sharp, controls, DataSet, datasource, Framework, internet-life, query, Visual Studio 2008, visual-studio-2005, winforms.
Trackback this post | Subscribe to the comments via RSS Feed