-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Senthil-Maverick
Message 1 in Discussion
hi
i do need to add data from Database to combo boxes in the windows application forms i
was previouslly doing applications in VB , where teh combo filing was so easy
just getting the values from teh recorset and running til teh EOF and filling the
combo's.
here i am finding a bit hard to do it... i am using c# . can yu guys say me what r the
easiest and best methods to do these..
one more issue is that when i add a default row in the combo itgets added only at the
end..
not as the first row... the code is like this :
SqlCommand sqlCmdSKill1 = new SqlCommand("ABC",sqlConn );
sqlCmdSKill1.CommandType = CommandType.StoredProcedure;
SqlDataAdapter custDA1 = new SqlDataAdapter();
custDA1.SelectCommand = sqlCmdSKill1;
DataTable dt1 = new DataTable();
dt1.TableName="skill1";
custDA1.Fill(dt1);
cboskill1.DataSource=dt1;
cboskill1.DisplayMember=dt1.Columns["Code"].ToString();
cboskill1.ValueMember=dt1.Columns["ID"].ToString();
// Setting the Default Selected Row
DataRow workRow1;
workRow1 = dt1.NewRow();
workRow1[0] = "0";
workRow1[1] = "NO Preference" ;
dt1.Rows.Add(workRow1);
cboskill1.SelectedValue =0;
but if i have the default row addition before the datasource binding , i am getting
only a black row.. so how to get the default rows in the first using datatable???
,, Senthil
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]