Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Generate DataSet Table Code

Generate DataSet Table Code

Scheduled Pinned Locked Moved C#
xmldatabasecomquestionannouncement
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 3426936
    wrote on last edited by
    #1

    All, I have a rather unusual situation, Tried to look for a solution online, but not able to, so I am posting it here. I have a dataset the loads and fills all the tables during app startup. When I copy a table and paste it in a notepad I get the following <?xml version="1.0" encoding="utf-8"?><xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"> xs:annotation <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"> <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> <ConnectionRefs /> <Connections /> <TableRefs> <DesignTableRef Name="IntersectionPedSignalNotes"> <ColumnRefs /> <SourceRefs /> </DesignTableRef> </TableRefs> <Tables /> <RelationRefs /> <SourceRefs /> <Sources /> </DataSource> </xs:appinfo> </xs:annotation> <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="NewDataSet" msprop:Generator_DataSetName="NewDataSet"> xs:complexType <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="IntersectionPedSignalNotes" msprop:Generator_TableClassName="IntersectionPedSignalNotesDataTable" msprop:Generator_TableVarName="tableIntersectionPedSignalNotes" msprop:Generator_TablePropName="IntersectionPedSignalNotes" msprop:Generator_RowDeletingName="IntersectionPedSignalNotesRowDeleting" msprop:Generator_UserTableName="IntersectionPedSignalNotes" msprop:Generator_RowChangingName="IntersectionPedSignalNotesRowChanging" msprop:Generator_RowEvHandlerName="IntersectionPedSignalNotesRowChangeEventHandler" msprop:Generator_RowDeletedName="IntersectionPedSignalNotesRowDeleted" msprop:Generator_RowEvArgName="IntersectionPedSignalNotesRowChangeEvent" msprop:Generator_RowChangedName="IntersectionPedSignalNotesRowChanged" msprop:Generator_RowClassName="IntersectionPedSignalNotesRow"> xs:complexType xs:sequence <xs:element name="NoteId" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-100" msdata:AutoIncrementSt

    L P 2 Replies Last reply
    0
    • M Member 3426936

      All, I have a rather unusual situation, Tried to look for a solution online, but not able to, so I am posting it here. I have a dataset the loads and fills all the tables during app startup. When I copy a table and paste it in a notepad I get the following <?xml version="1.0" encoding="utf-8"?><xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"> xs:annotation <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"> <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> <ConnectionRefs /> <Connections /> <TableRefs> <DesignTableRef Name="IntersectionPedSignalNotes"> <ColumnRefs /> <SourceRefs /> </DesignTableRef> </TableRefs> <Tables /> <RelationRefs /> <SourceRefs /> <Sources /> </DataSource> </xs:appinfo> </xs:annotation> <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="NewDataSet" msprop:Generator_DataSetName="NewDataSet"> xs:complexType <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="IntersectionPedSignalNotes" msprop:Generator_TableClassName="IntersectionPedSignalNotesDataTable" msprop:Generator_TableVarName="tableIntersectionPedSignalNotes" msprop:Generator_TablePropName="IntersectionPedSignalNotes" msprop:Generator_RowDeletingName="IntersectionPedSignalNotesRowDeleting" msprop:Generator_UserTableName="IntersectionPedSignalNotes" msprop:Generator_RowChangingName="IntersectionPedSignalNotesRowChanging" msprop:Generator_RowEvHandlerName="IntersectionPedSignalNotesRowChangeEventHandler" msprop:Generator_RowDeletedName="IntersectionPedSignalNotesRowDeleted" msprop:Generator_RowEvArgName="IntersectionPedSignalNotesRowChangeEvent" msprop:Generator_RowChangedName="IntersectionPedSignalNotesRowChanged" msprop:Generator_RowClassName="IntersectionPedSignalNotesRow"> xs:complexType xs:sequence <xs:element name="NoteId" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-100" msdata:AutoIncrementSt

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      I'm no DataSet expert at all, and I may be misunderstanding what you said, however it seems to me you want something like:

      DataTable table2=table1.Copy();
      table2.TableName="table2";
      dataset.Tables.Add(table2);

      :)

      Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

      Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

      M 1 Reply Last reply
      0
      • L Luc Pattyn

        I'm no DataSet expert at all, and I may be misunderstanding what you said, however it seems to me you want something like:

        DataTable table2=table1.Copy();
        table2.TableName="table2";
        dataset.Tables.Add(table2);

        :)

        Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

        M Offline
        M Offline
        Member 3426936
        wrote on last edited by
        #3

        Thanks, but this is not what I am looking for, I am talking about pasting the xml code when DataSet is opened using "View Designer". Once I copy the xml code generated by code generator and paste it in the DataSet designer window it should create the table.

        L 1 Reply Last reply
        0
        • M Member 3426936

          Thanks, but this is not what I am looking for, I am talking about pasting the xml code when DataSet is opened using "View Designer". Once I copy the xml code generated by code generator and paste it in the DataSet designer window it should create the table.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          OK, can't help you here, I never used the designer for databases. I can only recommend you edit and clarify your original question so more people may be inclined to reply. :)

          Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

          1 Reply Last reply
          0
          • M Member 3426936

            All, I have a rather unusual situation, Tried to look for a solution online, but not able to, so I am posting it here. I have a dataset the loads and fills all the tables during app startup. When I copy a table and paste it in a notepad I get the following <?xml version="1.0" encoding="utf-8"?><xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"> xs:annotation <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"> <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> <ConnectionRefs /> <Connections /> <TableRefs> <DesignTableRef Name="IntersectionPedSignalNotes"> <ColumnRefs /> <SourceRefs /> </DesignTableRef> </TableRefs> <Tables /> <RelationRefs /> <SourceRefs /> <Sources /> </DataSource> </xs:appinfo> </xs:annotation> <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="NewDataSet" msprop:Generator_DataSetName="NewDataSet"> xs:complexType <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="IntersectionPedSignalNotes" msprop:Generator_TableClassName="IntersectionPedSignalNotesDataTable" msprop:Generator_TableVarName="tableIntersectionPedSignalNotes" msprop:Generator_TablePropName="IntersectionPedSignalNotes" msprop:Generator_RowDeletingName="IntersectionPedSignalNotesRowDeleting" msprop:Generator_UserTableName="IntersectionPedSignalNotes" msprop:Generator_RowChangingName="IntersectionPedSignalNotesRowChanging" msprop:Generator_RowEvHandlerName="IntersectionPedSignalNotesRowChangeEventHandler" msprop:Generator_RowDeletedName="IntersectionPedSignalNotesRowDeleted" msprop:Generator_RowEvArgName="IntersectionPedSignalNotesRowChangeEvent" msprop:Generator_RowChangedName="IntersectionPedSignalNotesRowChanged" msprop:Generator_RowClassName="IntersectionPedSignalNotesRow"> xs:complexType xs:sequence <xs:element name="NoteId" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-100" msdata:AutoIncrementSt

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            Maybe deserialize it?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups