DataTable columns "not found" when filtering datarows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wbosw
    New Member
    • Mar 2007
    • 36

    DataTable columns "not found" when filtering datarows

    I created the following Sub to fill a DataSet with the Table named Developer. It binds to the Grid with no problems.


    Public Sub SearchSkills()

    Dim sqlcmd3 As SqlCommand = New SqlCommand

    sqlcmd3.Command Text = "SELECT DeveloperId, SkillsID, Name, SkillLevel, MonthsExperienc e, Skills FROM vDeveloperSkill s"

    sqlcmd3.Connect ion = connection

    Dim da As New SqlDataAdapter( sqlcmd3)

    Dim scb As New SqlCommandBuild er(da)

    Dim ds As New DataSet


    da.Fill(ds, "developer" )

    Me.GridView1.Da taSource = ds.Tables("deve loper")

    Me.GridView1.Da taBind()


    SearchOne()
    End Sub


    I then want to filter the Table("develope r") using the following code. However, the Table("develope r") does not have any columns. I checked the column count using Dim z As Integer = dt.Columns.Coun t.


    Dim DataRow2 As DataRow()

    Dim dt As DataTable = New DataTable("deve loper")

    DataRow2 = dt.Select("Skil lsId = '1'", "SkillsId DESC")

    For Each row As DataRow In DataRow2

    ListBox1.Items. Add(row("Skills Id "))

    Next


    Thanks,

    Wbosw
  • wbosw
    New Member
    • Mar 2007
    • 36

    #2
    Found the solution on another website

    Comment

    Working...