I have a database


Please tell me how can i get Last Balance from sql server

Try posting the work that you have done so far. If you are looking to be spoon fed the exact sql command to query your database, we are at least going to need to know a bit more about the database...

SELECT LastBalance FROM tablename WHERE condition_is_true

The condition will probably be something like ID=myID - it's something to identify the record by.

//1. to get a total of LastBalace:
"SELECT SUM(LastBalance) FROM Students";

//2. to get the last LastBalance 
"SELECT MAX(LastBalance) FROM Students";

//3. to get a specifc lastBalance
"SELECT LastBalance FROM Students WHERE StudentID = @id";
//pass an integer value to @id parameter!
/use SqlCommand(of OleDbCommand for Access) class.

//And use SqlDataReader class to read the value!
commented: best answer +3

Yes,This is .Mitja You are the best programmer at daniweb.my problem has been solved by your query

"SELECT LastBalance FROM Students WHERE StudentID = @id";