home | login | register | DMCA | contacts | help | donate |      

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


my bookshelf | genres | recommend | rating of books | rating of authors | reviews | new | | collections | | | add

- advertisement



, pubs ( U) 15 ( ).

4.8. DataReader TableDirect

Private Sub btnExecuteReader_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles btnExecuteReader.Click

' Connection.

Dim cnn As OleDbConnection = New OleDbConnection( _

"provider=SQLOLEDB;server=localhost;uid=sa;database=pubs")

' Command.

Dim As OleDbCommand = New OleDbCommand()

txtResults.Clear()

'

cmd.Connection = cnn

cmd.CommandType = CommandType.TableDirect

cmd.CommandText = "EmployeeJobs_View"

'

ExecuteReader. cnn.Open()

Dim reader As OleDbDataReader

reader = cmd.ExecuteReader{)

While reader.Read()

txtResults.Text = txtResults.Text & reader("fname") & _

ControlChars.Tab & reader("lname") & _

ControlChars.Tab & ControlChars.Tab & _

reader("job_desc") & ControlChars.CrLf

End While

reader.Close()

cnn.Close()

End Sub

( , EmployeeJobs_view btnNonQuery_Click 4.4, . . .)


4.7. ODBC | Visual Basic.NET | ExecuteReader