mohamad guntur

mohamad guntur

  • NA
  • 40
  • 31.3k

Overload resolution data adapter?

Nov 20 2012 3:29 AM
My code works fine with another form, but not this form..

anyway, i used the same code to retrieve ada from database

Public Sub GetData()


        If Not con.State = ConnectionState.Open Then
            con.Open()
        End If

        Dim da As New SqlDataAdapter("SELECT * FROM EMPLOYEE", con)
        Dim dt As New DataTable
        da.Fill(dt)
        Me.dgvKY.DataSource = dt
        con.Close()

    End Sub

I found this error caught:

Error 1 Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:
    'Public Sub New(selectCommandText As String, selectConnection As System.Data.SqlClient.SqlConnection)': Argument matching parameter 'selectConnection' narrows from 'Object' to 'System.Data.SqlClient.SqlConnection'.
    'Public Sub New(selectCommandText As String, selectConnectionString As String)': Argument matching parameter 'selectConnectionString' narrows from 'Object' to 'String'.


i used to follow this step, n everything is fine

http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx


please help :((