troubleshooting Question

dataset and datatables bind as "System.Data.DataRowView" instead of values

Avatar of cyimxtck
cyimxtckFlag for United States of America asked on
Visual Basic.NET
4 Comments1 Solution1064 ViewsLast Modified:
The correct number of rows is always returned but the output is the same for every row: "System.Data.DataRowView"

Can someone please explain to me why this is happening?

Any help is greatly appreciated.

Thanks,

B

Here is the function.  (I know it should be a sub, I just did this for quick illustration.)

    Protected Function YesNo() As DataSet

        Dim dt As DataTable
        dt = New DataTable("ColumnVal")
        Dim Row1, Row2, Row3 As DataRow

        Try
            Dim Name As DataColumn = New DataColumn("Name")
            'Name.DataType = System.Type.GetType("System.String")
            dt.Columns.Add(Name)

            Row1 = dt.NewRow()
            Row1.Item("Name") = sel.ToString
            dt.Rows.Add(Row1)

            Row2 = dt.NewRow()
            Row2.Item("Name") = "Yes".ToString
            dt.Rows.Add(Row2)

            Row3 = dt.NewRow()
            Row3.Item("Name") = "No".ToString
            dt.Rows.Add(Row3)
        Catch

        End Try

        Dim ds As New DataSet()
        ds = New DataSet()

        ds.Tables.Add(dt)

        cbo1.DataSource = ds.Tables("ColumnVal")
        cbo1.DataBind()

        Return ds

    End Function
ASKER CERTIFIED SOLUTION
Priest04

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros