title: StoredProcedure returning multiple resultset Sql To Linq using designer
body: <p>I want to get multiple resultsets from a storedProc using sql to linq. I was not able to generate it from designer so I wrote below code in designer.cs file. But whenever I add something to designer, it refreshes the designer with the markup in .dbml file and hence it removes the below code every time I add something. I have to copy it every time. If I can get corresponding dbml markup for this, it would be great. </p>
  
  <pre><code>[Function(Name = "dbo.GetAllModulesAndOptions")]
  [ResultType(typeof(Module))]
  [ResultType(typeof(ModuleOption))]
  public IMultipleResults GetAllModules()
  {
    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
    return ((IMultipleResults)(result.ReturnValue));
  }
  </code></pre>
  
  <p>I've already defined Module and ModuleOption as tables.
  Now when I add below markup in .dbml file it complains 
  <code>DBML1114: The Name attribute 'Module' of the Type element is already used by another type.</code></p>
  
  <pre><code>  &lt;Function Name="dbo.GetAllModulesAndOptions" Method="GetAllModules"&gt;
      &lt;ElementType Name="Module"&gt;
        &lt;Column Name="ModuleId" Type="System.Int64" DbType="BigInt NOT NULL" CanBeNull="false" /&gt;
        &lt;Column Name="ModuleName" Type="System.String" DbType="VarChar(50)" CanBeNull="true" /&gt;
        &lt;Column Name="Description" Type="System.String" DbType="VarChar(255)" CanBeNull="true" /&gt;
        &lt;Column Name="SalesDesc" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" /&gt;
        &lt;Column Name="ParentModuleId" Type="System.Int32" DbType="Int" CanBeNull="true" /&gt;
      &lt;/ElementType&gt;
      &lt;ElementType Name="ModuleOption"&gt;
        &lt;Column Name="ModuleOptionId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /&gt;
        &lt;Column Name="ModuleOptionName" Type="System.String" DbType="VarChar(50)" CanBeNull="true" /&gt;
        &lt;Column Name="ModuleOptionDesc" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" /&gt;
        &lt;Column Name="DefaultPrice" Type="System.Decimal" DbType="Money" CanBeNull="true" /&gt;
        &lt;Column Name="ModuleId" Type="System.Int64" DbType="BigInt" CanBeNull="true" /&gt;
        &lt;Column Name="InUse" Type="System.Int32" DbType="Int" CanBeNull="true" /&gt;
      &lt;/ElementType&gt;
    &lt;/Function&gt;
  </code></pre>
  
  <p>I'm using Visual Studio 2008 SP1</p>