Keep getting this error. Using ASP datagrid

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim connectionString As String = WebConfigurationManager.ConnectionStrings("connectionstring").ConnectionString
        Dim selectSQL As String = "SELECT * FROM checkInOut"
            Dim con As New SqlConnection(connectionString)
            Dim cmd As New SqlCommand(selectSQL, con)
            Dim adapter As New SqlDataAdapter(cmd)
            ' Fill the DataSet.
            Dim ds As New DataSet()
        adapter.Fill(ds, "checkInOut")
            ' Perform the binding.
        checkInOutGV.DataSource = ds
        checkInOutGV.DataBind()

        End Sub

Recommended Answers

All 2 Replies

check in your Markup file if checkInOutGV have already a DatasourceID set. If so, remove it.

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.