Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » Data » Downloads
 
Add your own
alternative version

Generic Paging for Recordset with Next Back Navigation

, 20 Jun 2005 CPOL
This article is basically about a Paging control required for project purposes. One can use this just by changing three parameters.
Paging_src.zip
Paging
bin
Paging.dll
Global.asax
Paging.csproj.webinfo
style
_vti_cnf
_vti_pvt
access.cnf
deptodoc.btr
doctodep.btr
service.cnf
service.lck
services.cnf
_vti_script
_vti_txt
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;

namespace Paging
{
	/// <summary>
	/// Summary description for ReadData.
	/// </summary>
	public class ReadData
	{
		private string strSelectQuery;
		private string strConn;
		public ReadData()
		{
			//
			// TODO: Add constructor logic here
			//
			strSelectQuery=null;
			strConn=null;
		}
		public ReadData(string _strQuery,string _conn)
		{
			strSelectQuery=_strQuery;
			strConn=_conn;
		}
		public DataTable LoadRecordIntoTable()
		{
			SqlConnection objConn=new SqlConnection(strConn);
			DataTable tblOfRec =new DataTable();

			try
			{
				objConn.Open();
				//Using helps to dispose object as soon as 
				//required process gets complete
				using(SqlDataAdapter objAdpOnCat=new SqlDataAdapter(strSelectQuery,objConn))
				{

					objAdpOnCat.Fill(tblOfRec);
					
				}

			
			}
			catch(SqlException e)
			{
				throw new Exception("Invalid Connection Error Occured  "+e.Message);

			}
			finally
			{
				if(objConn.State.ToString()=="Open")
				{
					objConn.Dispose();
					objConn.Close();
					
				}
			}
			return tblOfRec;
		
		
		}

	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

santosh poojari
Technical Lead
India India
Whatsup-->Exploring--> MVC/HTML5/Javascript & Virtualization.......!
www.santoshpoojari.blogspot.com

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141220.1 | Last Updated 21 Jun 2005
Article Copyright 2005 by santosh poojari
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid