469,282 Members | 2,034 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

how to transfer value from dropdownlist to datatable?


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?


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>
Jul 31 '09 #1
3 2337
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

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
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.

Similar topics

1 post views Thread by DC Gringo | last post: by
2 posts views Thread by Przemek | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.