TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nandhini Jayachandran
NA
117
43.6k
Sql query
Jul 27 2013 2:58 AM
Dim constring As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\appln\appln\Acc.accdb"
Dim insertcmd As System.Data.OleDb.OleDbCommand = New System.Data.OleDb.OleDbCommand
Dim con As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection
con.ConnectionString = constring
insertcmd.CommandType = CommandType.Text
insertcmd.CommandText = String.Format("select sum(total) from account where ID between {0} and {1}", TextBox1.Text, TextBox2.Text)
insertcmd.Connection = con
con.Open()
Try
insertcmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
con.Close()
this is code i am using but i dnt know how to get total from database ...
Reply
Answers (
13
)
Sql query
SQL does not return rows using variable in string