473,387 Members | 3,787 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,387 software developers and data experts.

How can i access a column and put it in select tag of html ?

80
Hi
in my table (sql server 2000) 'repeat' there is a column named 'repeat' but when i accessed it from sql server and put in select tag in html i am only getting that last one..
In that column there are three rows one ,two and three...
But it only gets displaying the last one that is 'three'...
How can i tell to be shown in full.. that one ,two and three...

Did anybody please tell me how can i overcome from this situation ???
Thanks....

Expand|Select|Wrap|Line Numbers
  1. <%@ page language = "java" import = "java.sql.*" %>
  2. <html>
  3. <body>
  4. <%! String str; %>
  5. <%
  6. try
  7.     {
  8.     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  9.     Connection con = DriverManager.getConnection("jdbc:odbc:MyDataSource","sa","");
  10.     Statement stat = con.createStatement();
  11.     ResultSet result = stat.executeQuery("select repeat from repeat");
  12.  
  13.     while(result.next())
  14.         {
  15.         str= result.getString(1);
  16.         }
  17.             %>
  18.  
  19.             <select name = "sel">
  20.             <option value = " " selected>Choose any
  21.             <option><%= str %>
  22.             </select>
  23.  
  24.             <%
  25.  
  26.     }
  27. catch(Exception e)
  28.     {
  29.     %><%= e %><%
  30.     }
  31. %>
  32. </body>
  33. </html>
Aug 5 '07 #1
0 805

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

Similar topics

14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
41
by: Ruby Tuesday | last post by:
Hi, I was wondering if expert can give me some lite to convert my word table into access database. Note: within each cell of my word table(s), some has multi-line data in it. In addition, there...
14
by: dixie | last post by:
What is the best way to implement a front end for an access database via a web browser on a private intranet? This is totally new ground for me. I want to allow users to enter information into...
3
by: Alienz | last post by:
Anybody? This is probably a very simple question. I am just testing this on my own. I have 2 tables: Table name:fields Employer: Employer Number (primary key), Employer Name Employee: SIN,...
3
by: Mike S | last post by:
Anyone know how I can access a MS Access database from perl? Any help appreciated.
3
by: syounger | last post by:
Hi. I have a report in Access 2000 that is based on selection made from a series of interdependent list boxes. The boxes I have right now are Source, Table, Column, Date. The user chooses Source...
0
by: nkparimi | last post by:
Hi, Here's what I'm trying: given an html table, to freeze the column headers and/or left column in IE. I understand that this is possible thru style sheets in IE, as suggested in the following:...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.