473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to transfer value from dropdownlist to datatable?

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
3 2517
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
itboy1
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
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

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

Similar topics

12
by: Stanley J Mroczek | last post by:
How do you load a dropdownlist when edit is clicked in a datagrid ? <Columns> <asp:BoundColumn DataField="OptionDescription" ItemStyle-Wrap="True" HeaderText="Option...
1
by: Mike Bridge | last post by:
I'm getting a nonsensical error when binding a DataTable with one row to a DropDownList. The DataTable's row contains the fields "id" (INT), "description" (VARCHAR) and with a couple other...
8
by: utterberg | last post by:
Hi I'm adding two dropdownlist in my webform by clicking a button. I fill the first dropdown with some values from my DB and the other one when I choose from the first dropdown. But since theese...
1
by: DC Gringo | last post by:
I have a dropdownlist that is bound to a recordset. The default selected item has turned out to be the first record in my table. I need a row that has value = 0 and text showing "--ALL". How...
7
by: Simon Verona | last post by:
I posted this in dotnet.languages.vb.controls but thought I'd post here as well.. I have a combobox that is bound to a dataview generated from a dataset. The dataset has a single table...
2
by: Billy | last post by:
Change DataGrid EditControl On Data Value Hi, I have a datagrid, and on editing, I want to change the control in the third colunm based on the value of the first column. The value in the...
2
by: Przemek | last post by:
Hi, I've populated my dropdown list from database (category table) via datatable. It's showing categories in strings. The problem appears, when I want to add new record to database...
0
by: den 2005 | last post by:
Hi everybody, I created a Gridview with a TemplateField and there is Label control in ItemTemplate and a DropdownList control in EditItemTemplate, I was to displayed them ok when I click the...
0
by: dit | last post by:
Hello, I found this piece of code for selecting a dropDownlist value in a repeater: <aspropDownList id=ddl DataSource="<%# SourceTable %>" runat="server" DataTextField="Name"...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.