Results 1 to 6 of 6

Thread: select query

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2008
    Posts
    382

    select query

    Code:
    Public con As OleDbConnection
        Public cmd As OleDbCommand
        Public dr As OleDbDataReader
    
    con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\student.mdb;")
            con.Open()
    str = "select name," & textbox1.text & " from Table1" 'textbox1.text="Address"
    
    cmd = New OleDbCommand(str, con)
    dr = cmd.ExecuteReader()
    
    While dr.Read()
    MsgBox(dr(0))
    MsgBox(dr(1))
    End While
    dr.Close()
    what wrong in this querry ?

    it give error in dr(1) ..
    Last edited by CatchItBaby; Aug 2nd, 2010 at 04:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width