Exposing schema collection information help!... RRS feed

  • Question

  • I am writing a program to display all the schema collections and there values.  I can display all the collections, but I don’t have a clue as to how to display their values. What properties in the DataRow contains the values for the DataType?

    Code Snippet

    private void linkLabelGetSchema_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


    DataTable colSchema = null;

    ListViewItem listViewItem;


    m_dbSchema = m_sqlDbEng.m_DbConnection.GetSchema();

    for (int i = 0; i < m_dbSchema.Rows.Count; i++)


    DataRow dataRow = m_dbSchema.Rows[i];

    ...the first column in the ListView is the Collection name

    ...and the first name in dataRow is "MetaDataCollections",

    ...where is the values for "NumberOfRestriction"

    ...and "NumberOfIdentifierParts"


    listViewItem = listViewMetaDataCollections.Items.Add(dataRow["CollectionName"].ToString());


    ...when I try to do this


    ...I get the exception error

    Message="Column 'NumberOfRestriction' does not belong to table MetaDataCollections."







    Thursday, August 23, 2007 9:30 PM

All replies

  • Cancel That!


    I found the property were the variables are.  There here in the ItemArray of the DataRow class:


    Code Snippet

    for (int l = 0; l < dataRow.ItemArray.Length; l++)


    if (l == 0)

    listViewItem = listViewMetaDataCollections.Items.Add(dataRow.ItemArray[l].ToString());






    Friday, August 24, 2007 6:43 AM