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
Solved

movenext and movelast

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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