i want to show records from other tables but this error occurs

Sub fillorderdetail()

        conn.Open()
       
        Dim adpt As New SqlDataAdapter("select * from orderdetail", conn)
        Dim ds As New DataSet
        adpt.Fill(ds, "orderdetail")
        DataGridView2.DataSource = ds.Tables("orderdetail")
        conn.Close()
       
    End Sub

There will be something wrong with the connection string for the connection object. Where and how are you specifying the connection object?

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.