i have code in jsp but the problem is i need to convert this to asp.........pleasehelp me regarding this im sending code which i've have....with file names..........
code.jsp
<%@ page import = "java.util.*" %>
<%@ page import = "java.io.*" %>
<%@ page import = "java.lang.*" %>
<%@ page import = "org.apache.commons.fileupload.*" %>
<%@ page import = "java.sql.*" %>
<%
try{
Connection con = null;
Class.forName("oracle.jdbc.driver.OracleDriver");
String user="scott";
String password="tiger";
System.out.println("errrrrrrrrr");
con=DriverManager.getConnection("jdbcracle:thin:@l ocalhost:1521:welcome",user,password);
System.out.println("errrrrrrrrragain");
String name = null;
int icon = 0;
String name1=null,country1=null,state1=null,gender1=null, age1=null,pref_lang1=null,emailid1=null,comment1=n ull,story1=null,url=null;
File uploadFile=null;
response.setContentType("text/html");
DiskFileUpload df=new DiskFileUpload();
List items=df.parseRequest(request);
Iterator iter=items.iterator();
while(iter.hasNext())
{
FileItem item=(FileItem)iter.next();
if(item.isFormField())
{
name=item.getFieldName();
if(name.equals("name"))
{
name1=item.getString();
}
else if(name.equals("country"))
{
country1=item.getString();
}
else if(name.equals("state"))
{
state1=item.getString();
}
else if(name.equals("gender"))
{
gender1=item.getString();
}
else if(name.equals("age"))
{
age1=item.getString();
}
else if(name.equals("language"))
{
pref_lang1=item.getString();
}
else if(name.equals("emailid"))
{
emailid1= item.getString();
}
else if(name.equals("comment"))
{
comment1= item.getString();
}
else if(name.equals("story"))
{
story1= item.getString();
}
}
else
{
String locPath = item.getString();
String subPath = locPath.substring(0,locPath.indexOf("."));
url ="c:\\bhanu\\"+name1+".jpeg";
uploadFile=new File(url);
item.write(uploadFile);
out.println("File Uploaded Successfully.......");
}
}
PreparedStatement stmt = con.prepareStatement("insert into join_us values(?,?,?,?,?,?,?,?,?,?)");
stmt.setString(1,name1);
stmt.setString(2,country1);
stmt.setString(3,state1);
stmt.setString(4,gender1);
stmt.setString(5,age1);
stmt.setString(6,pref_lang1);
stmt.setString(7,emailid1);
stmt.setString(8,comment1);
stmt.setString(9,story1);
stmt.setString(10,url);
stmt.executeUpdate();
out.println("Your details has been uploaded");
session.setAttribute("name","name1");
RequestDispatcher rd = request.getRequestDispatcher("codeDisplay.jsp");
rd.forward(request,response);
}
catch(Exception e){
System.out.println("errrrrrrrrr");
e.printStackTrace();
}
%>
codeDisplay.jsp
<HTML>
<HEAD>
</HEAD>
<%@page import="java.sql.*"%>
<BODY bgcolor="#000000"><center>
<marquee bgcolor="#CC6699"><b>STOP TEARS</b></marquee><BR><BR><BR>
<h2><font color="#993366">STOP TEARS</font></h2>
<!--<form action="code.jsp" method="post" >-->
<% String strName=null,strCountry=null,strState=null,strGend er=null,strLang=null,strEmail=null,strComment=null ,strStory=null,strImage=null,strAge=null;
%>
<%try{ String name = (String) session.getAttribute("name");
Connection con=null;
Statement stmt=null;
DriverManager.registerDriver((Driver) Class.forName("oracle.jdbc.driver.OracleDriver").n ewInstance());
con=DriverManager.getConnection("jdbcracle:thin:@l ocalhost:1521:welcome","scott","tiger");
stmt=con.createStatement();
//retriving data from database
ResultSet rs=stmt.executeQuery("select * from join_us");
while(rs.next()){
// ResultSet rs=stmt.executeQuery("select * from join_us");
strName = ""+rs.getString(1);
strCountry = rs.getString(2);
strState = rs.getString(3);
strGender = rs.getString(4);
strAge = rs.getString(5);
strLang = rs.getString(6);
strEmail = rs.getString(7);
strComment = rs.getString(8);
strStory = rs.getString(9);
strImage = rs.getString(10);
}//while close
}//try close
catch(Exception e){e.printStackTrace();}
%>
<table border=1 width="929" height="411">
<tr><th width="805" height="1"><font color="#669900">Personal Details</font></th></tr>
<tr><td width="805" height="102">
<IMG
border="0" src=<%=strImage%> width="125" height="100"><b><font color="#CC9900">Name</font><INPUT readonly type='text'name='Name' value='<%=strName%>' size="32"></b><font color="#CC9900"><b>Country<INPUT readonly type='text' name='Country' value='<%=strCountry%>' size="20">
State<INPUT readonly type='text'name='State' value='<%=strState%>' size="20">
</b></font>
<p><font color="#CC9900"><b> & nbsp; &nb sp;   ;   ; Gender<INPUT readonly type='text'name='Gender' value='<%=strGender%>' size="10"> Age<INPUT readonly type='text'name='Age' value='<%=strAge%>' size="5"> Language<INPUT readonly type='text'name='' value='<%=strLang%>' size="20"> Email-id<INPUT readonly type='text'name='' value='<%=strEmail%>' size="20">
</b></font></p>
<p><font color="#CC9900"><b> & nbsp; &nb sp;   ; & nbsp; Comment<INPUT readonly type='textarea' name='' value='<%=strComment%>' size="85">
</b></font></p>
<p><font color="#CC9900"><b> & nbsp; &nb sp;   ; & nbsp; Story<INPUT readonly type='textarea' name='' value='<%=strStory%>' size="89">
</b></font></p>
<p> </td>
</tr>
</table>
</body>
</html>