Using GetOleDbSchemaTable to get SQL Server Field Description - using

Discussion in 'ASP .Net' started by pete, Aug 29, 2003.

  1. pete

    pete Guest

    Hi All,

    I am trying to get the field desriptions from SQL Server
    2000 using GetOleDbSchemaTable (see code below)
    Now this returns a description field to the DataTable, but
    the field is empty. I know my fields have descrptions
    assigned to them. Has anyone seen this before, is it a bug
    in ASP.NET. or am I missing something?

    I am using win2000 server / IIS5 / .NET v1.0.3705 /
    SQLServer2000.


    Dim strTableName As String = "MyTable"
    Dim myConn As OleDBConnection = New OleDBConnection
    (ConfigurationSettings.AppSettings("strMyConnString"))
    myConn.Open()
    Dim schemaTable As DataTable = myConn.GetOleDbSchemaTable
    (OleDbSchemaGuid.Columns, New Object() {Nothing, Nothing,
    strTableName, Nothing})

    myDataGrid1.DataSource = schemaTable

    myDataGrid1.DataBind()
     
    pete, Aug 29, 2003
    #1
    1. Advertising

  2. pete

    Jon Yates Guest

    Pete,

    I have just tried this using C# and Oracle and I also
    didn't get any comments brought back.

    Jon

    >-----Original Message-----
    >Hi All,
    >
    >I am trying to get the field desriptions from SQL Server
    >2000 using GetOleDbSchemaTable (see code below)
    >Now this returns a description field to the DataTable,

    but
    >the field is empty. I know my fields have descrptions
    >assigned to them. Has anyone seen this before, is it a

    bug
    >in ASP.NET. or am I missing something?
    >
    >I am using win2000 server / IIS5 / .NET v1.0.3705 /
    >SQLServer2000.
    >
    >
    >Dim strTableName As String = "MyTable"
    >Dim myConn As OleDBConnection = New OleDBConnection
    >(ConfigurationSettings.AppSettings("strMyConnString"))
    >myConn.Open()
    >Dim schemaTable As DataTable = myConn.GetOleDbSchemaTable
    >(OleDbSchemaGuid.Columns, New Object() {Nothing, Nothing,
    >strTableName, Nothing})
    >
    >myDataGrid1.DataSource = schemaTable
    >
    >myDataGrid1.DataBind()
    >
    >.
    >
     
    Jon Yates, Aug 29, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cosmos
    Replies:
    0
    Views:
    1,876
    cosmos
    Oct 23, 2003
  2. J Sahoo
    Replies:
    3
    Views:
    5,313
    naikpalak
    Apr 30, 2009
  3. Radu
    Replies:
    0
    Views:
    700
  4. Radu
    Replies:
    0
    Views:
    1,699
  5. Sound
    Replies:
    2
    Views:
    465
    Randy Webb
    Sep 28, 2006
Loading...

Share This Page