hi...
i have one function in my c # application.
this is to add one field from the table to the combo box.
but i have to use this function in many forms ,
instead of writing this function in all the forms is there any other way where i can write the function only once and i can call it anywhere ?
if it is so can u tell me with example ...
pls....
public void PopulateId()
{
ds.Clear();
string qry = "select distinct(PID) from tbl_Registraion order by PID";
da = new SqlDataAdapter(qry, con);
da.Fill(ds, "tbl_Registraion");
dt = ds.Tables["tbl_Registraion"];
combobox1.Items.Clear();
foreach (DataRow tdr in dt.Rows)
{
combobox1.Items.Add(tdr["PID"]);
}
}