views:

41

answers:

0

I would like an automated way to run compile time checks on datasets (or any xml) to make sure that expected values are found for certain properties. I have a fairly complex dataset in my asp.net Web Site. After modifying a query Visual Studio regenerates the tableadapter object and returns many properties to their default values. This isn't a problem during initial development because I know what the values need to be set to but this will not be the case during future maintenance. An example:

  • A query that performs an insert and then selects SCOPE_IDENTITY needs the ExecuteMode property to be set to Scalar; not Reader or NonQuery.

I would like the build process to fail if this property is set to anything but Scalar. The relevant xml path in the xsd is:

<xs:schema>
 <xs:annotation>
  <xs:appinfo>
   <DataSource>
    <Tables>
     <TableAdapter Name="TheTable">
      <Sources>
       <DbSource QueryType="Scalar">