Avatar of Anthony Matovu
Anthony Matovu
Flag for Uganda

asked on 

how to specify the table name during table load from a dataset

Dear Exeperts,

I have a function below that works fine, I would like to specify the table name during data load function, and tname is the table name

Anthony


   Public Function loadtableintodataset(ByVal st As String, ByVal tname As String) As Boolean
        loadtableintodataset = True
        '  ocmd = New OracleCommand
        Try
            ocmd.Connection = conn
            ocmd.CommandText = st
            ocmd.CommandType = CommandType.Text
            odrd = ocmd.ExecuteReader
            dtab = New DataTable
            If odrd.HasRows Then
                dtab.Load(odrd)
            End If
            ds.Tables.Add(dtab)
            odrd.Close()
        Catch ex As Exception
            loadtableintodataset = False
        Finally
        End Try
    End Function
.NET ProgrammingVisual Basic.NETASP.NET

Avatar of undefined
Last Comment
Karrtik Iyer

8/22/2022 - Mon