Solved

movenext and movelast

Posted on 2004-09-15
7
459 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

8 Experts available now in Live!

Get 1:1 Help Now