Click here to Skip to main content
13,189,506 members (69,759 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hello, The problem is Code is working when
rs.getString<br />
(1) is integer number, but in my case it's a varchar primary key , how to fix this.

function getId(id){
    var f=document.form;
    f.method="post";
    f.action='SelectBank1.jsp?id='+id;
    f.submit();
}

<%
Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select IdwhichIsVarchar, description from  SomeDataBase where IS_VISIBLE = 1 order by description  ");
%>
 
<%
while(rs.next()){
%>
<tr><td><%=rs.getString(2)%></td>
 
<td><input type="button" name="edit" value="Edit" style="background-color:green;font-weight:bold;color:white;" onclick="getId(<%=rs.getString(1)%>);" ></td>
</tr>
<%
}
%>
Posted 4-Dec-12 8:15am
krasi89378
Updated 4-Dec-12 8:52am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.171016.2 | Last Updated 4 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100