Results 1 to 5 of 5

Thread: Visual basic 2008 Info System Need Help on my PORBLEM PLEASE :(

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    2

    Visual basic 2008 Info System Need Help on my PORBLEM PLEASE :(

    hello good day im a 2nd yr it student doing my program thesis an info sytem about a police station.. now i got a problem in on of my procedure Create_Table
    this is a part of my CRUD

    Code:
    Private Sub Create_Table()
            dt = New DataTable("Temp")
            cmd = New OleDbCommand("Select from InmateInfo", cn)
            cn.Open()
            dr = cmd.ExecuteReader
            dt.Clear()
            For i = 0 To dr.FieldCount - 1
                dt.Columns.Add(dr.GetName(i), dr.GetFieldType(i))
            Next
            While dr.Read
                Dim drw As DataRow = dt.NewRow
                For i = 0 To dr.FieldCount - 1
                    drw(i) = dr(i)
                Next
                dt.Rows.Add(drw)
            End While
            dr.Close()
            cn.Close()
            DataGridView1.DataSource = dt
    my dr = cmd.ExecuteReader always shows an error every time i click my form.. .anyone can help and show my mistakes?
    Last edited by gep13; Mar 22nd, 2011 at 02:27 AM. Reason: Added Highlight Tags

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