Search code examples
sqlvb.netoracle11gnocount

How to SET NOCOUNT ON in a vb.net


Setting "SET NOCOUNT ON" in an application always benefits the performance of the application. But how i can set it in my vb.net application in a VB.net project? Here are my code

Dim myConn As OleDbConnection
Dim myAdapter As OleDbDataAdapter
Dim myDts As New DataSet
Dim strSql As String = "select * from table_issue"
myConn = New OleDbConnection(oldeb_connection_string)
myAdapter = New OleDbDataAdapter(strSql, myConn)
myAdapter.Fill(myDts,"table_issue")

Solution

  • Dim strSql As String = "SET NOCOUNT OFF; select * from table_issue; SET NOCOUNT ON;"