|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hi All,
I pls want a help in my piece of code, I am actually populating the form with data from an MS SQL Database, but I want to concatenate the firstname with the output been dispalyed in the Text Area. Below is my code; Thnaks Abd <% category = TRIM( Request.Form( "cat" ) ) username = TRIM( Request.Form( "username" ) ) IF username <> "" THEN Set Con = Server.CreateObject( "ADODB.Connection" ) Con.Open "PROVIDER=SQLOLEDB;DATA SOURCE=ABD;UID=sa;PWD=abd;DATABASE=abdul" Set RS= Server.CreateObject( "ADODB.Recordset" ) If category = "Globe" then RS.Open "select * from globe where phonenum = '" &username& "'", Con firstname = RS.Fields("firstname") lastname = RS.Fields("lastname") middlename = RS.Fields("middlename") homeadd = RS.Fields("homeadd") busadd = RS.Fields("busadd") terrifplan = RS.Fields("terrifplan") state = RS.Fields("state") phonenum = RS.Fields("phonenum") typeofpay = RS.Fields("typeofpay") assignedto = RS.Fields("assignedto") nservicereq = RS.Fields("nservicereq") //Comment = RS.Fields("Comment") End if Con.Close Set RS = Nothing Set Con = Nothing END IF %> <Html> <head><title>Return Data</title> </head> <body> <form name="form1" method="post" action="updcsr.asp?cate"> <input type="text" id="globe2" value="Globe2" name="cate" readonly> <h1 align="center"><font color="blue" size=+2>Customer Demographic Information</font></h1> <br> <b>First Name:</b> <input name="FirstName" type="text" value="<%=Server.HTMLEncode(firstname)%>" readonly> <b>Last Name:</b> <input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(lastname)%>" readonly> <b>Middle Name:</b> <input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(middlename)%>" readonly> <p> <b>Home Address:</b> <input name="Address" type="text" size="17" value="<%=Server.HTMLEncode(homeadd)%>" readonly> <b>Business Address:</b> <input name="PositionCode" type="text" size="15" value="<%=Server.HTMLEncode(busadd)%>" readonly> <b>Tarrif Plan:</b> <input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(terrifplan)%>" readonly> <p> <b>State:</b> <input name="Address" type="text" value="<%=Server.HTMLEncode(state)%>" readonly> <font color="blue"><b>Phone Number:</b></font> <input name="PositionCode" type="text" size="18" value="<%=Server.HTMLEncode(phonenum)%>" readonly> <p> <b>Mode of Payment:</b> <input name="Address" type="text" value="<%=Server.HTMLEncode(typeofpay)%>" readonly> <hr> <br> <% //Populating Text Area with an entire column data from the Database Set Conn = Server.CreateObject("ADODB.Connection") Conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=ABD;UID=sa;PWD=abd;DATABASE=abdul" Set rs=Conn.execute("Select nservicereq from globe") Commnet = RS.Fields("nservicereq") response.write "<b>Service Reqst History:</b><br><TEXTAREA NAME='Comment' ROWS=5 COLS=80>"&vbcrlf while not rs.eof response.write ""&rs("nservicereq")&""&vbcrlf rs.movenext wend response.write "</TEXTAREA>"&vbcrlf rs.close set rs=nothing Conn.close set Conn=nothing %> <p align="center"><input type="submit" value="New Request"> <p> </form> <SCRIPT LANGUAGE="JavaScript"> //To Hide Globacom Textbox document.getElementById("globacom2").style.display = 'none' </SCRIPT> </body> </html> |
|
#2
|
||||
|
||||
|
I don't see the problem
why not just add Response.write firstname after: while not rs.eof response.write ""&rs("nservicereq")&""&vbcrlf rs.movenext wend ! My apologies if I miss-understood the question |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Concatenating Control buttons |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|