By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,659 Members | 940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,659 IT Pros & Developers. It's quick & easy.

how to transfer value from dropdownlist to datatable?

P: 3
hii

i m making a page where i have used Dropdownlist and in that i have put 2 drop down list (1) Year( 2)month so in datatable i want a liek if u have 1 year and 3 month . i want it like that pattern.

in data table i have taken only 1 field(experience varchar2(10))

so could u plss tell me how to do coding for that? and what should i have to take in datatable?

thnks.


Expand|Select|Wrap|Line Numbers
  1. <td class="style15">
  2.                 <asp:Label ID="lblExp" runat="server" Font-Bold="True" ForeColor="Blue" 
  3.                     Text="Experience"></asp:Label>
  4.             </td>
  5.             <td class="style9" valign="top">
  6.                 <asp:DropDownList ID="DropDownList5" runat="server" AutoPostBack="True">
  7.                     <asp:ListItem>Select</asp:ListItem>
  8.                     <asp:ListItem>1</asp:ListItem>
  9.                     <asp:ListItem>2</asp:ListItem>
  10.                     <asp:ListItem>3</asp:ListItem>
  11.                     <asp:ListItem>4</asp:ListItem>
  12.                     <asp:ListItem>5</asp:ListItem>
  13.                     <asp:ListItem>6</asp:ListItem>
  14.                     <asp:ListItem>7</asp:ListItem>
  15.                     <asp:ListItem>8</asp:ListItem>
  16.                     <asp:ListItem>9</asp:ListItem>
  17.                     <asp:ListItem>10</asp:ListItem>
  18.                     <asp:ListItem>11</asp:ListItem>
  19.                 </asp:DropDownList>
  20.             &nbsp;&nbsp; <b>Years&nbsp;</b>&nbsp;&nbsp;&nbsp;
  21.                 <asp:DropDownList ID="DropDownList6" runat="server" AutoPostBack="True">
  22.                     <asp:ListItem>Select</asp:ListItem>
  23.                     <asp:ListItem>1</asp:ListItem>
  24.                     <asp:ListItem>2</asp:ListItem>
  25.                     <asp:ListItem>3</asp:ListItem>
  26.                     <asp:ListItem>4</asp:ListItem>
  27.                     <asp:ListItem>5</asp:ListItem>
  28.                     <asp:ListItem>6</asp:ListItem>
  29.                     <asp:ListItem>7</asp:ListItem>
  30.                     <asp:ListItem>8</asp:ListItem>
  31.                     <asp:ListItem>9</asp:ListItem>
  32.                     <asp:ListItem>10</asp:ListItem>
  33.                     <asp:ListItem>11</asp:ListItem>
  34.                     <asp:ListItem>12</asp:ListItem>
  35.                 </asp:DropDownList>
  36. &nbsp;&nbsp;&nbsp;<b> Months</b></td>
  37.             <td>
  38.  
Jul 31 '09 #1
Share this Question
Share on Google+
3 Replies


P: 44
If they select 5 years and 2 months, then you can enter
(5*12)+2 = 62 months experience to enter into your datatable field.

If you want to fill out the dropdowns with the info from the datatable, all you do is
(experience / 12) to get number of years for the Years dropdown, then (experience mod 12) to get the number of months for the Months dropdown.
Aug 1 '09 #2

P: 3
hii

thnks for your reply.

i got answer but the thing which i want to know is how to trasnfer dropdownlist value to database as specially these two colum? exp and year.

what coding i have to write for that in c#?

wt should i have to take in datatable?
Aug 1 '09 #3

P: 44
well you only have one field called "experience"..... if you want to store the value of both dropdowns, you'll need two fields...
Aug 1 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.