Click here to Skip to main content
15,922,015 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am importing excel file in a table
Now i have add one more column in that table i.e year


so my table is like


slno name rollno year
1 abc 1111
2 bcs 1200
3 yry 2312

now i need to populate the year till the data is filled in the table

Using dropdown i want to added the year
if i select

2010-11

output will be

slno name rollno year
1 abc 1111 2010-11
2 bcs 1200 2010-11
3 yry 2312 2010-11
Posted

get the value of the dropdown with the help of selected index changed event and update your table.
 
Share this answer
 
DataTable workTable = new DataTable("Customers");

DataColumn workCol = workTable.Columns.Add("YEAR", typeof(Int32));
workCol.DefaultValue =dropdown.SelectedValue;

//bind  gridview  with workTable 
 
Share this answer
 
Comments
10923679 5-Aug-14 8:02am    
well this insert selected value from dropbox to table

till i have my data filled ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900