Answered by:
Data Binding

Question
-
How wil I bind data to some combobox?Thursday, March 8, 2007 9:55 AM
Answers
-
Its quite simple.. This is a sample code using C# and ADO.Net...
Here 'Authors' is the table name.. and 'name' is the column name
Code:
DataView
dv = ds.Tables["Authors"].DefaultView;dataGrid1.DataSource = dv;
comboBox1.DataSource = dv;
comboBox1.DisplayMember =
"name";This wil do...
Friday, March 9, 2007 9:06 AM -
For more info, chk out msdn.com and dotnet.comFriday, March 9, 2007 9:07 AM
All replies
-
Its quite simple.. This is a sample code using C# and ADO.Net...
Here 'Authors' is the table name.. and 'name' is the column name
Code:
DataView
dv = ds.Tables["Authors"].DefaultView;dataGrid1.DataSource = dv;
comboBox1.DataSource = dv;
comboBox1.DisplayMember =
"name";This wil do...
Friday, March 9, 2007 9:06 AM -
For more info, chk out msdn.com and dotnet.comFriday, March 9, 2007 9:07 AM
-
GVS_here wrote: How wil I bind data to some combobox? its very easy my dear friend go to combobox properties then in databinding ->datasource select the dataset ->then after tis in datamember/display member property select the table from drop-down list.
and u r done with it but first create data adapter, connection and dataset before u proceed for above steps
hope this works, in case of problem do let me know inthis thread.
bye....
Sunday, March 11, 2007 6:30 AM -
thats ofcourse good.. rather than typing everything.. This UI wil be good
Monday, March 12, 2007 7:25 AM -
for more info, chk out codeproject and w3schools.com
Monday, March 12, 2007 7:25 AM -
if u r familiar with WPF,thats very easy to do just specify element and its value.Monday, June 4, 2007 6:31 AM
-
Refer to the data binding section in the beginners developers center ..........its very easy to do data binding with C# and SQL Server ............Wednesday, June 6, 2007 1:52 PM