Click here to Skip to main content
15,891,864 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How can i check textbox null in grid view using javascript Pin
bommareddy20024-Jul-08 21:24
bommareddy20024-Jul-08 21:24 
GeneralRe: How can i check textbox null in grid view using javascript Pin
Sherin Iranimose24-Jul-08 23:00
Sherin Iranimose24-Jul-08 23:00 
QuestionCrystal Report not working Pin
Raghvendra Kumar Roy24-Jul-08 19:34
Raghvendra Kumar Roy24-Jul-08 19:34 
QuestionInsert data from girdview to sql server database ASP.NET c# Pin
VijayVishwakarma24-Jul-08 19:12
VijayVishwakarma24-Jul-08 19:12 
Questionmail server checking Pin
Member 387988124-Jul-08 18:33
Member 387988124-Jul-08 18:33 
AnswerRe: mail server checking Pin
Sam Xavier24-Jul-08 20:18
Sam Xavier24-Jul-08 20:18 
AnswerRe: mail server checking Pin
Abhijit Jana24-Jul-08 21:38
professionalAbhijit Jana24-Jul-08 21:38 
QuestionReading from access Pin
kamsabeti24-Jul-08 18:15
kamsabeti24-Jul-08 18:15 
Recetly we update our database on access. we addedd more cloumns of data on one of the tables. I have five tables on the access " active,master,customer,user,...)The table I added more cloumn is "master" table. before we had: part-no., descrption,price" now we have "part-no.,descption,price,MVC,NRC,NPN". the ASP program it will upload an excel file with part-no. and qty then it will display the data from these two tables"active and master" by active being the first choice the master the second. can you please look at this ASP code to see how can i add other column to be printed with new data. Thanks. Kamran


<!--#include file="conn.asp"-->
<!--#include file="verify.asp"-->
<html>
<head>
<title>new page</title>
<link rel="stylesheet" type="text/css" href="css.css">
<meta http-equiv="Content-Type" content="text/html;">
</head>
<body>
<form name="form" method="post" action="savexls.asp" enctype="multipart/form-data" >
<input type="file" name="file1" size="20">
<input type="submit" name="Submit" value="UPLOAD">
<p>
</p>
<%
set rst = server.createobject("adodb.recordset")
sql="select top 1 * from active"
rst.open sql,conn,1,1
%>
<table style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%" id="AutoNumber3" cellspacing="1" height="0" border="1">
<tr>
<% j=0
for each x in rst.fields %>
<% fieldname=trim(x.name)
if fieldname="pn" then
fieldname="Part-No."
end if
if fieldname="price" then
fieldname="Cost"
end if

if j=2 then %>
<td width="7%" height="50" align="center" bgcolor="#E1E1E1"><b><font face="Arial" style="font-size: 11pt">Qty</font></b></td>

<td height="50" align="center" bgcolor="#E1E1E1"><b><font face="Arial" style="font-size: 11pt"><%=ucase(left(fieldname,1))&right(fieldname,len(fieldname)-1)%></font></b></td>

<% else
%>
<td height="50" align="center" bgcolor="#E1E1E1"><b><font face="Arial" style="font-size: 11pt"><%=ucase(left(fieldname,1))&right(fieldname,len(fieldname)-1)%></font></b></td>
<%
end if
j=j+1
next
%>
<td align="center" bgcolor="#E1E1E1" height="50"><b><font face="Arial" style="font-size: 11pt">Source</font></b></td>
<td align="center" bgcolor="#E1E1E1" height="50"><b><font face="Arial" style="font-size: 11pt">MVC&NRC</font></b></td>
<td align="center" bgcolor="#E1E1E1" height="50"><b><font face="Arial" style="font-size: 11pt">NPN</font></b></td>
</tr>


<%
rst.close
set rst=nothing
if request("id")=1 then
set conn1 = server.createobject("adodb.connection")
name=trim(request("name"))
FileName="xls\"&name
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source ="&Server.MapPath(FileName)&";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
Conn1.Open ConnStr

set rs = server.createobject("adodb.recordset")
set rs1 = server.createobject("adodb.recordset")
sql = "select * from [sheet1$]"
rs.open sql,conn1,1,1
do While Not Rs.EOF
i=1
for each x in rs.fields
if i=1 then
text1=x.name
end if
if i=2 then
text2=x.name
end if
i=i+1
next
'strpn=trim(rs("pn"))
strpn=trim(rs(text1))
'strquantity=trim(rs("quantity"))
strquantity=trim(rs(text2))
datafrom="None"
description=""
price=""
sql1="select * from active where pn='"&strpn&"'"
rs1.open sql1,conn,1,1
IF Rs1.Eof And Rs1.Bof Then
rs1.close
sql2="select * from master where pn='"&strpn&"'"
rs1.open sql2,conn,1,1

if Rs1.Eof And Rs1.Bof Then
datafrom="None" %>
<tr><td><font face="Arial" style="font-size: 10pt"> <%=strpn%></font></td><td>&nbsp;</td><td><font face="Arial" style="font-size: 10pt"><%=strquantity%></font></td>
<% for diffn=1 to j-2 %><td>&nbsp;</td><% next %><td><font face="Arial" style="font-size: 10pt"><%=datafrom%></font></td> </tr>
<% else
datafrom="Master"
do While Not Rs1.EOF
m=0 %><tr>
<%

for each x in rs1.fields
if m=2 then
xvalue="$"&trim(x.value) %>
<td><%=strquantity%></td>
<% else
xvalue=trim(x.value)
end if

%>
<td><font face="Arial" style="font-size: 10pt"><%=xvalue%></font></td>

<% m=m+1
next

if m<j then
for dif=1 to j-m
%><td>&nbsp;</td>
<%
next
end if
%>
<td><font face="Arial" style="font-size: 10pt"><%=datafrom%></font></td>
</tr>
<% rs1.MoveNext
loop

end if
else
datafrom="Active"
do While Not Rs1.EOF
m=0
%> <tr>
<% for each x in rs1.fields
if m=2 then
xvalue="$"&trim(x.value)
%> <td><%=strquantity%></td>
<% else
xvalue=trim(x.value)
end if

%>
<td><font face="Arial" style="font-size: 10pt"><%=xvalue%></font></td>

<% m=m+1
next %>
<td><font face="Arial" style="font-size: 10pt"><b><font color=#ff0000><%=datafrom%></font></b></font></td>
</tr>
<% rs1.MoveNext
loop

end if

Rs1.Close
rs.MoveNext

Loop


%>
</table>

</form>
<form name="form1" method="post" action="quote.asp?id=1&name=<%=name%>">
<b><font face="Arial" style="font-size: 11pt">Please Input Customer's NAME:</font></b>
<input type="text" name="email" size="20">
<input type="submit" name="continue" value="CONTINUE">
</form>
<form name="form2" method="post" action="quote.asp?id=1&name=<%=name%>">
<b><font face="Arial" style="font-size: 11pt">Select A Customer's Name:</font></b>
<p> </p>
<select name="email">

<%
sql3="select * from customer"
set rs3 = server.createobject("adodb.recordset")
rs3.open sql3,conn,1,1
if rs3.eof and rs3.bof then
response.write "Not record."
else
do while not rs3.eof
response.write "<option " & " value='" + Cstr(rs3("name")) + "'>" + rs3("name") + "</option>"
rs3.MoveNext
Loop
end if
rs3.close
set rs3=nothing
%>
</select>
<input type="submit" name="continue" value="CONTINUE">

</form>

<%
Rs.Close
Set Rs=nothing
Conn1.Close
Set Conn1=Nothing


Set Rs1=nothing
Conn.Close
Set Conn=Nothing
end if
%>
</body>
</html>
Questionajax tabcontainer add new tabpanel with close button Pin
Bharani_Ram24-Jul-08 10:01
Bharani_Ram24-Jul-08 10:01 
QuestionHow to search data from database then populate at gridview? Pin
edwin7nice24-Jul-08 4:55
edwin7nice24-Jul-08 4:55 
AnswerRe: How to search data from database then populate at gridview? Pin
edwin7nice24-Jul-08 5:20
edwin7nice24-Jul-08 5:20 
QuestionHow to update dropdownlist.selectedvalue into database? Pin
edwin7nice24-Jul-08 4:45
edwin7nice24-Jul-08 4:45 
AnswerRe: How to update dropdownlist.selectedvalue into database? Pin
Sherin Iranimose24-Jul-08 4:52
Sherin Iranimose24-Jul-08 4:52 
GeneralRe: How to update dropdownlist.selectedvalue into database? Pin
edwin7nice24-Jul-08 5:26
edwin7nice24-Jul-08 5:26 
GeneralRe: How to update dropdownlist.selectedvalue into database? Pin
Sherin Iranimose24-Jul-08 5:38
Sherin Iranimose24-Jul-08 5:38 
QuestionHow to add a contol(adrotator) in which pictures keep changing without refreshing the page?? Pin
diksha_g24-Jul-08 3:08
diksha_g24-Jul-08 3:08 
AnswerRe: How to add a contol(adrotator) in which pictures keep changing without refreshing the page?? Pin
windhopper24-Jul-08 20:46
windhopper24-Jul-08 20:46 
AnswerRe: How to add a contol(adrotator) in which pictures keep changing without refreshing the page?? Pin
drahmedgalal25-Jul-08 23:45
drahmedgalal25-Jul-08 23:45 
GeneralRe: How to add a contol(adrotator) in which pictures keep changing without refreshing the page?? Pin
Anudeep Jaiswal1-Aug-08 0:58
Anudeep Jaiswal1-Aug-08 0:58 
QuestionHow to provide database Search Functionality? Pin
vannapragada24-Jul-08 2:36
vannapragada24-Jul-08 2:36 
AnswerRe: How to provide database Search Functionality? Pin
Imran Khan Pathan24-Jul-08 2:58
Imran Khan Pathan24-Jul-08 2:58 
GeneralRe: How to provide database Search Functionality? Pin
Paddy Boyd24-Jul-08 3:29
Paddy Boyd24-Jul-08 3:29 
AnswerRe: How to provide database Search Functionality? Pin
www.Developerof.NET24-Jul-08 20:47
www.Developerof.NET24-Jul-08 20:47 
QuestionJavascript to convet english to french Pin
bommareddy20024-Jul-08 2:33
bommareddy20024-Jul-08 2:33 
AnswerRe: Javascript to convet english to french Pin
J4amieC24-Jul-08 4:34
J4amieC24-Jul-08 4:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.