hi
see the code below and fix the prob in it , wat changes i made to the code , so it give a desire result(i.e paging).
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data" %>
<%@ Page Language="
vb" AutoEventWireup="false" Codebehind="print.aspx.
vb" Inherits="g.print"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>fcustprint</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script runat="server">
Sub next1(sender As Object, e As EventArgs)
TextBox1.Text = Val(TextBox1.Text) + 5
End Sub
Sub prev1(sender As Object, e As EventArgs)
TextBox1.Text = Val(TextBox1.Text) - 5
End Sub
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:textbox id="TextBox1" style="Z-INDEX: 103; LEFT: 296px; POSITION: absolute; TOP: 80px" runat="server"
Height="16px" Width="112px"></asp:textbox><asp:linkbutton id="lb1" style="Z-INDEX: 105; LEFT: 240px; POSITION: absolute; TOP: 88px" onclick="next1"
runat="server" Height="16px" Width="32px">Next</asp:linkbutton><asp:linkbutton id="LinkButton1" style="Z-INDEX: 106; LEFT: 168px; POSITION: absolute; TOP: 88px"
onclick="prev1" runat="server" Height="16px" Width="40px">Previuos</asp:linkbutton></form>
<strong>Geofman Pharmaceutical
<br>
Field Person Cities Customers Report</STRONG>
<br>
Report Date and Time :<%response.write(date.now()) %>
<br>
<br>
Type :
<% response.write(request.querystring("r"))%>
<%
dim m as string
m = request.querystring("r")
if m ="All" then
%>
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 112px" cellSpacing="1"
cellPadding="1" width="300" border="1">
<%
dim con1 as new oledb.oledbconnection
dim command1 as new oledbcommand
Dim sql1 As String
dim dr1
con1 = New OleDbConnection(ConfigurationSettings.AppSettings( "connectionstring1"))
con1.Open()
sql1="select top 5 city_name,city_id from city where city_id in (select top " & val(TextBox1.Text) & " city_id from city where city_id in (" & session("B") & ") order by city_id asc) order by city_id desc"
command1.CommandText = sql1
command1.Connection = con1
dr1 = command1.ExecuteReader
%>
<% while dr1.read %>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<TR>
<TD><strong><% response.write(request.querystring("ft"))%> & nbsp; <% response.write(dr1("city_name")) %></strong></TD>
</TR>
<%
dim con as new oledb.oledbconnection
dim command as new oledbcommand
Dim sql As String
dim dr
con = New OleDbConnection(ConfigurationSettings.AppSettings( "connectionstring1"))
con.Open()
sql="Select top 5 c.customer_id,c.customer_name from customer c, field_under_customer fuc where fuc.customer_id in (select top " & val(TextBox1.Text) & " fuc.customer_id from customer c,field_under_customer fuc where c.city_id='" & dr1("city_id") & "'" & " and c.types=c.types and fuc.customer_id=c.customer_id and fuc.field_person_id ='"& request.querystring("fv") & "' order by c.customer_id asc) and fuc.field_person_id ='"& request.querystring("fv") & "' and fuc.customer_id=c.customer_id and c.city_id in (" & session("B") & ") and c.types=c.types order by c.customer_id desc"
command.CommandText = sql
command.Connection = con
dr = command.ExecuteReader
%>
<TR>
<TD><STRONG>Customer Name</STRONG></TD>
</TR>
<% while dr.read %>
<TR>
<TD><% response.write(dr("customer_name"))%></TD>
</TR>
<% end while %>
<% end while %>
</TABLE>
<%
elseif m ="Distributor" or m="Direct" then
%>
<TABLE id="Table2" style="Z-INDEX: 102; LEFT: 8px; POSITION: absolute; TOP: 112px" cellSpacing="1"
cellPadding="1" width="300" border="1">
<%
dim con as new oledb.oledbconnection
dim command as new oledbcommand
Dim sql As String
dim dr
con = New OleDbConnection(ConfigurationSettings.AppSettings( "connectionstring1"))
con.Open()
sql="Select c.customer_name,c.customer_id from customer c, field_under_customer fuc where fuc.field_person_id='" & request.querystring("fv") & "' and fuc.customer_id=c.customer_id and c.city_id in (" & request.form("l2") & ") and c.types='" & request.querystring("r") & "'"
command.CommandText = sql
command.Connection = con
dr = command.ExecuteReader
%>
<%
dim con1 as new oledb.oledbconnection
dim command1 as new oledbcommand
Dim sql1 As String
dim dr1
con1 = New OleDbConnection(ConfigurationSettings.AppSettings( "connectionstring1"))
con1.Open()
sql1="select city_name from city where city_id in (" & request.form("l2") & ")"
command1.CommandText = sql1
command1.Connection = con1
dr1 = command1.ExecuteReader
%>
<% while dr1.read %>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<TR>
<TD><strong><% response.write(request.querystring("ft"))%> & nbsp; <% response.write(dr1("city_name")) %></strong></TD>
</TR>
<TR>
<TD><STRONG>Customer Name</STRONG></TD>
</TR>
<% while dr.read %>
<TR>
<TD><% response.write(dr("customer_name"))%></TD>
</TR>
<% end while %>
<% end while %>
</TABLE>
<% end if %>
</body>
</HTML>