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).**

"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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.