Simple Execute Scalar Example
  • executescalar() function only single value 

    we use execute scalar when you want to get hight salary , low salary,total no or rows , maximum no etc which result is only one row

    con.Open()
    Dim daadapter As SqlDataAdapter
    Dim dt As New DataTable

    dim cmd as new sqlcoomand("Select MAX(UserID) from config",con)


       dim i as integer=cmd.executescalar()

    this is the way through which you donot use datatable and your application is fast.
     
    con.Close()

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week