Solved

movenext and movelast

Posted on 2004-09-15
7
460 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

864 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now