0

this is the coding i have done

Private Sub Refreshdata()

    If Not cnn.State = ConnectionState.Open Then
        'open connection
        cnn.Open()
    End If

    Dim da As New OleDb.OleDbDataAdapter("SELECT stockid as [stockid], " & _
                                        "size as [size], shape, weight, color, clarity, cut, polish " & _
                                        "sym as [sym], flo, report, reportnumber " & _
                                        "table as [table], depth, measure, brown, green, milky, black" & _
                                        " FROM stock ORDER by stockid", cnn)

    Dim dt As New DataTable
    'fill data to datatable
    da.Fill(dt)

    'offer data in data table into datagridview
    Me.STOCKLISTDataGridView.DataSource = dt

    'close connection
    cnn.Close()
End Sub

** bt error comes like at da.Fill(dt)
IErrorInfo.GetDescription failed with E_FAIL(0x80004005).**

2
Contributors
1
Reply
8
Views
2 Years
Discussion Span
Last Post by cgeier
0

"table" is a reserved word. I don't recommend using reserved words as column names, even if permitted by surrounding it with "[]". Check all of your column names to see if they are reserved words for the database that you are using.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.