使用VB.NET的ceonvert函数ASP.NET出错 [英] Error in ceonvert function ASP.NET using VB.NET

查看:81
本文介绍了使用VB.NET的ceonvert函数ASP.NET出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我正试图翻转数据集,以便在ASP.NET中使用VB.NET翻转我的gridview



我正在使用此代码



Hello

I'm trying to flip Dataset so as to flip my gridview in ASP.NET using VB.NET

I'm using this code

Public Function FlipDataSet(ByVal my_DataSet As DataSet) As DataSet
        Dim ds As New DataSet()


        For Each dt As DataTable In my_DataSet.Tables
            Dim table As New DataTable()

            For i As Integer = 0 To dt.Rows.Count
                table.Columns.Add(Convert.ToString(i))
            Next i
            Dim r As DataRow
            For k As Integer = 0 To dt.Columns.Count - 1
                r = table.NewRow()
                r(0) = dt.Columns(k).ToString()
                For j As Integer = 1 To dt.Rows.Count
                    r(j) = dt.Rows(j - 1)(k)
                Next j
                table.Rows.Add(r)
            Next k

            ds.Tables.Add(table)
        Next dt

        Return ds
    End Function







错误已开启(转换)



如图所示



http://q8sch.net/upload/convert.png [ ^ ]

推荐答案

您在类名称转换的某处具有受保护的方法这会隐藏Convert类。你可以使用完整的命名空间告诉编译器在哪里找到Convert:

You have protected method somewhere in the class that is named Convert this hides the Convert class. You can either use full namespace to tell the compiler where to find Convert:
System.Convert.ToString(i)



或直接在整数值上直接调用ToString:


or simply call ToString on the integer value directly:

i.ToString()


这篇关于使用VB.NET的ceonvert函数ASP.NET出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆