Need to do this in .NET

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

In ASP I used the following Code to get the table name
from a XL db. I have been looking how to do this in .NET
and can't seem to find it. Can any of you guys help me
out.

strTable = getXLName(XLConn)

Function getXLName(obj)
SET RsN = obj.OpenSchema(20)
getXLName = RsN("TABLE_NAME")
RsN.Close
End Function
 
Dim SheetList As System.Data.DataTable =
conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, New
object() { Nothing, Nothing, Nothing, "TABLE"})
' here, we get the name of the first (0th) sheet
SheetName= "[" & SheetList.Rows(0)("TABLE_NAME").ToString()
& "]"
 
Thanks. I was moving in that direction. I couldn't figure
out how to get only the first name.

Thanks again!
-----Original Message-----
Dim SheetList As System.Data.DataTable =
conn.GetOleDbSchemaTable
(System.Data.OleDb.OleDbSchemaGuid.Tables, New
object() { Nothing, Nothing, Nothing, "TABLE"})
' here, we get the name of the first (0th) sheet
SheetName= "[" & SheetList.Rows(0) ("TABLE_NAME").ToString()
& "]"



In ASP I used the following Code to get the table name
from a XL db. I have been looking how to do this in .NET
and can't seem to find it. Can any of you guys help me
out.

strTable = getXLName(XLConn)

Function getXLName(obj)
SET RsN = obj.OpenSchema(20)
getXLName = RsN("TABLE_NAME")
RsN.Close
End Function


.
 
Back
Top