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
- <%@ page language = "java" import = "java.sql.*" %>
- <html>
- <body>
- <%! String str; %>
- <%
- try
- {
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- Connection con = DriverManager.getConnection("jdbc:odbc:MyDataSource","sa","");
- Statement stat = con.createStatement();
- ResultSet result = stat.executeQuery("select repeat from repeat");
- while(result.next())
- {
- str= result.getString(1);
- }
- %>
- <select name = "sel">
- <option value = " " selected>Choose any
- <option><%= str %>
- </select>
- <%
- }
- catch(Exception e)
- {
- %><%= e %><%
- }
- %>
- </body>
- </html>