29 Posted Topics
Re: dude you need to declare the global variable in program.cs it would help you to access such variable in every form. try this out if it wont works i will show you an example by retrieving username and usertype which is your need | |
Hi, I have a scenario where in I had to sort an array, find duplicates and increment one or the other by 1. So, Eg: An array has 22, 23, 21, 21, 24 within it then, an array should be able to find 21 and increment it by 1 i.e. … | |
Re: 1. well you can directly connect that page2 textboxes to the datatbase using datareader so that value of the textboxes come from the database on the page_load. 2. Else you can use a simple querystring where you can add value of that textboxes by declaring a string on the Response.Redirect … | |
I simply want to forward a request of one servlet to another servlet. Authentication Servlet gets a request from a jsp page and thus authenctication servlet passes the request to another Addtocart servlet. AuthenticationServlet Code: [CODE] RequestDispatcher rd= request.getRequestDispatcher("/Addtocart"); rd.forward(request, response); response.sendRedirect("Addtocart"); [/CODE] Addtocart servlet code: [CODE] String pid = … | |
Instance variable does mean you will get new value with every new object created of particular class rite? I tried it myself eg: [CODE]class simpleinstcheck { static int i; void incr() { System.out.println(i++); } public static void main(String args[]) { simpleinstcheck sc= new simpleinstcheck(); sc.incr(); simpleinstcheck sc1= new simpleinstcheck(); sc1.incr(); … | |
Exception in inserting date into database [CODE] String Fname= request.getParameter("txtfname"); String Lname= request.getParameter("txtlname"); String Uname=request.getParameter("txtuname"); String Pass=request.getParameter("txtpass"); String Email=request.getParameter("txtemail"); String Gender=request.getParameter("group1"); String Add=request.getParameter("txtadd"); java.sql.Date sqlDate = new java.sql.Date(new java.util.Date().getTime()); //out.println(""+Fname+Lname+Uname+Pass+Email+Gender+Add); Connection con= null; //if(Fname != null && Lname != null && Uname != null && Pass != null && Email … | |
I only wanted to print the value in the string variable fname but somehow am not able to use the jsp tags effectively. [CODE] <%@page language="java" import="java.util.*" %> <% Cookie[] c= request.getCookies(); if(c==null) { response.sendRedirect("index.jsp"); } else { for (int i=0; i<c.length; i++) { if(c[i].getName().equals("Cuname")) { try{ Connection con=null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); … | |
Re: Yes obviously it is possible....instead of asking you should have tried yourself atleast once | |
Re: clear your browser cookies and form data.... may be this can help you out | |
There is some problem when i check username and validate it against password from my database.After checking password from request.getParamter() it should say "You have been successfully login"... Perhaps I am getting my own else block message"Incorrect Password..." which means there is some problem with the password thing. Here is … | |
I am facing problem in storing an image file into sql server. Following is my jsp page form tag which calls a servlet which has the storage code.. [CODE] <form name="form" action="NewServlet" method="POST" enctype="multipart/form-date"> <input type="file" name="file" size="20"> <input type="submit"> </form> [/CODE] here is my servelt code for the same … | |
I have been assigned a task to develop an online store.I am facing a problem at the time of insertion of records into SQL Database. I am using Type4 driver. The name of the DNS is SQL. here is my servlet code [CODE] protected void doPost(HttpServletRequest request, HttpServletResponse response) throws … | |
I got a jsp page which forwards request of two textfields txtname and txtpass to a servlet and the servlet then inserts the data into sql db and the name of the db is online_store. The db has two columns. When i checked the values are passing to the servlet … | |
hi, am working on a project called online store using java. For the navigation menu bar i used javascript in a jsp page. The problem is am unable to see the image in navigation bar. Since i have no thorough knowledge of javascript please rectify me.Here is my code [CODE] … | |
I have created a jsp page with some credentials of the user and this time i dont want it to pass to the validation form servlet through doGet() but through doPost(). I am facing some problem while doing this validation of none of the field could be left blank. [CODE] … | |
Re: OleDbDataAdapter o = new OleDbDataAdapter("select * from tblExam1", conn); DataSet ds = new DataSet("tblExam1"); o.Fill(ds, "tblExam1"); DataRow r = ds.Tables["tblExam1"].NewRow(); r["exam1ID"]=324; r["patID"] = patid; r["ypsos"] = 32; ds.Tables["tblExam1"].Rows.Add(r); r.Update(ds, "tblExam1"); ds.AcceptChanges(); You just forgot the update statement & if possible give name to the dataset as i did.... | |
Re: no ways it has no rlation with the web app speed. go and try it :) | |
I have uploaded some flash content into my html website but when i upload it on the server am unable to see it. I have registered the website of mine but unable to find a way for this problem. heres my code [CODE] <td colspan="6"><script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','932','height','359','src','Building','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','Building' ); //end … | |
I wrote a program to get first 100 no. which are divisible by 3. Heres the code [CODE] import java.io.*; class app { public static void main (String args[]) { for(int i=0; i<=100; i++) { int x; try{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter your no."); x= Integer.parseInt(br.readLine()); if(x%3==0) { System.out.println("The … | |
I have designed a jsp which has the following code : [CODE] <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Form Cookie</title> </head> <body> <form action="http://localhost:8080/FormCookie/AddValue"> Name : <input type="text" name="name"><br> Age : <input type="text" name="age"> <input type="submit" value="submit"> </form> </body> … | |
What is the use of requestdispatcher in java? I know it is used to forward requests to servlets. But somebody could give me example or i mean to say a scenario which will prove effective in understanding this concept.... | |
I am a beginner to advance java and since am learning servlet am getting some weird error in my servlet. I am trying to get the method name and this is the code which i wrote down [CODE] import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; public class NewServlet extends … | |
Re: i think it is easy to find out user created databases as they are four in numbers namely model, master, Tempdb, msdb and Distribution database in created while sql server instance is configured as a distribution for replication. and i think there is no such query for aforesaid question | |
protected void Button1_Click(object sender, EventArgs e) { MailMessage message = new MailMessage(); message.From = new MailAddress(YourEmail.Text.ToString()); message.To.Add(new MailAddress("purohit.mith@gmail.com")); message.Subject = "Message via mith from " + YourName.Text.ToString(); message.Body = Comments.Text.ToString(); SmtpClient client = new SmtpClient(); client.Host = "203.92.50.112"; client.Send(message); } // this is what i used to send the email … | |
I am currently storing the values retrieved from the user form including image supplied by the user to sql database. The image is stored in the database but at the time when am trying to retrieve that image am getting the following exception Parameterized Query '(@name varchar(8000))select firstname,image from register … | |
| |
Re: //The name od DropDownList is ddl1 switch(ddl1.SelectedItem.ToString()) { case "abc": TextBox1.text="first content"; break: case "xyz": TextBox1.text="second content"; break: case "any other content": TextBox1.text="third content"; break: } //and so on try this out & write this code on DropDownList click event | |
Re: [code] cmd.ExecuteNonQuery should be replaced by cmd.ExecuteReader(); [/code] i just have an example hope you understand this [code] cn.Open(); SqlDataAdapter da = new SqlDataAdapter("select * from register", cn); SqlCommandBuilder cmd = new SqlCommandBuilder(da); DataSet ds = new DataSet("register"); da.Fill(ds,"register"); DataRow dr = ds.Tables["register"].NewRow(); dr["firstname"] = txtfname.Text; dr["lastname"] = txtlname.Text; dr["loginname"] … | |
Re: have you tried <connection string> method in web.config? if yes i will show you another but in case you can deal with the same method which we use in ADO.Net if you are using Gridview control Gridview1.DataSource = ds; //Dataset object Gridview1.DataBind(); //Establishes mapping between the data column //in dataset … |
The End.