How to Navigate to the last record in the DataBase ?

itayzoro

Member
Joined
Jul 28, 2008
Messages
23
Programming Experience
Beginner
I just need the right SQL line instead of Sum



VB.NET:
Imports System.Data 
Imports System.IO 



Dim sConnectionString, sSQL As String 
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\127.0.0.1\DataBase\Demo.mdb 
sSQL = "SELECT SUM([IN]) AS Expr1 FROM DATA_COUNTER" 
Dim conn As New System.Data.OleDb.OleDbConnection(sConnectionString) 
Dim cmd As New System.Data.OleDb.OleDbCommand(sSQL, conn) 
Dim dr As System.Data.OleDb.OleDbDataReader 
  
conn.Open() 
dr = cmd.ExecuteReader() 
dr.Read() 
Label1.Text = dr.Item("Expr1") 
dr.Close() 
conn.Close()
 

Latest posts

Back
Top