Solved

movenext and movelast

Posted on 2004-09-15
7
465 Views
Last Modified: 2008-02-01
what code to movenext and movelast record also the connection to database . its for paging but not use a datagrid.

thk
0
Comment
Question by:erpin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 12063886
There are quite a bit of ways to access data in a database, can you be much more specific as to which objects you are using to do so?  
0
 
LVL 9

Expert Comment

by:hismightiness
ID: 12065059
Yeah, exactly how/what are you trying to put together?
0
 

Author Comment

by:erpin
ID: 12071290
i use asp.net and vb language. My database is sql server ;
my question : 1. kind code to conect database
                     2. how to movenext or move last record??

all from code behind
0
 
LVL 9

Accepted Solution

by:
hismightiness earned 250 total points
ID: 12075103
You sound like I did when I first came into the .Net world because I was used to VBScript and ASP.  It was very hard to get out of thinking in terms of Recordset and ADO functionality, but you have a much broader range of functionality and possibilities with ADO.Net.  

Here is an example though:

        ' make your connection
        Dim conn As New SqlConnection("server=SERVERNAME;database=DBNAME;User Id=USERNAME;Password=PASSWORD;")
        ' use a command
        Dim cmd As New SqlCommand("SELECT STATEMENT", conn)
        ' insert the command into a dataadapter
        Dim da As New SqlDataAdapter(cmd)
        Dim ds As New DataSet
        ' fill the dataset
        da.Fill(ds, "TABLENAME")
        Dim dv As DataView = New DataView(ds.Tables("TABLENAME"))

        Dim strFirstValue, strLastValue As String
        strFirstValue = dv.Item(0)("FIELDNAME")
        strLastValue = dv.Item(dv.Count)("FIELDNAME")

        ' finish it up
        dv.Dispose()
        ds.Dispose()
        da.Dispose()
        conn.Dispose()
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question