Vb.net 亚音速通过VS2008使用子命令导致以下错误-请提供帮助

Vb.net 亚音速通过VS2008使用子命令导致以下错误-请提供帮助,vb.net,.net-3.5,subsonic,subsonic3,subsonic2.2,Vb.net,.net 3.5,Subsonic,Subsonic3,Subsonic2.2,我一直在使用子命令生成我的dal。Im使用vb.net、sqlexpress和.NET3.5 我的网络配置看起来像这样 <!-- add subsonic in for dal--> <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" allowDefinition="MachineToApplication" requirePermission="false"/> &

我一直在使用子命令生成我的dal。Im使用vb.net、sqlexpress和.NET3.5

我的网络配置看起来像这样

<!-- add subsonic in for dal-->
    <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" allowDefinition="MachineToApplication" requirePermission="false"/>
</configSections>
<connectionStrings>

    <!-- Development connection string -->
    <add name="kimconnection" connectionString="Data Source=7NQ384J\SQLExpress;Initial Catalog=kim2;Integrated Security=True;"/>
</connectionStrings>

<!--Add my provider for subsonic to my database-->
<SubSonicService defaultProvider="kimAppProvider">
    <providers>
        <clear/>
        <add name="kimAppProvider" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="kimconnection" generatedNamespace="kimdata"/>
    </providers>
</SubSonicService>
<appSettings>


<!--Add my provider for generating my dal / classes-->
<buildProviders>
    <add extension=".abp" type="SubSonic.BuildProvider, SubSonic"/>
</buildProviders>

好吧,我的问题是,如果我注释掉我的构建提供程序(因为我认为我在使用子命令生成类时没有使用它),我就无法在我的aspx代码中导入kimdata以访问类

然而,如果我留下这个是,(即不注释它),然后我在VisualStudio中调试我的代码,我会得到超过200个错误,错误消息是“语句不能出现在方法体之外”

在调试时,错误似乎显示了我编译的应用程序代码,问题是这是c#,我使用vb,我生成的类是vb,默认语言是vb,那么为什么这是c#,这是我出错的原因吗?或者还有其他原因,我如何解决这个问题,因为我的应用程序不会像很多ERORR那样运行

#ExternalChecksum("d:\dscott\windows\Visual Studio 2008\WebSites\KimV2\App_Code\builder.abp","{406ea660-64cf-4c82-b6f0-42d48172a799}","ECAA88F7FA0BF610A5A26CF545DCD3AA")
using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;

namespace kimdata
{
 /// <summary>
 /// Strongly-typed collection for the AlertMessage class.
 /// </summary>
    [Serializable]
 public partial class AlertMessageCollection : ActiveList<AlertMessage, AlertMessageCollection>
 {    
  public AlertMessageCollection() {}

        /// <summary>
  /// Filters an existing collection based on the set criteria. This is an in-memory filter
  /// Thanks to developingchris for this!
        /// </summary>
        /// <returns>AlertMessageCollection</returns>
  public AlertMessageCollection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                AlertMessage o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }


 }
 /// <summary>
 /// This is an ActiveRecord class which wraps the alertMessages table.
 /// </summary>
 [Serializable]
 public partial class AlertMessage : ActiveRecord<AlertMessage>, IActiveRecord
 {
  #region .ctors and Default Settings

  public AlertMessage()
  {
    SetSQLProps();
    InitSetDefaults();
    MarkNew();
  }

  private void InitSetDefaults() { SetDefaults(); }

  public AlertMessage(bool useDatabaseDefaults)
  {
   SetSQLProps();
   if(useDatabaseDefaults)
    ForceDefaults();
   MarkNew();
  }

  public AlertMessage(object keyID)
  {
   SetSQLProps();
   InitSetDefaults();
   LoadByKey(keyID);
  }

  public AlertMessage(string columnName, object columnValue)
  {
   SetSQLProps();
   InitSetDefaults();
   LoadByParam(columnName,columnValue);
  }

  protected static void SetSQLProps() { GetTableSchema(); }

  #endregion

  #region Schema and Query Accessor 
  public static Query CreateQuery() { return new Query(Schema); }
  public static TableSchema.Table Schema
  {
   get
   {
    if (BaseSchema == null)
     SetSQLProps();
    return BaseSchema;
   }
  }

  private static void GetTableSchema() 
  {
   if(!IsSchemaInitialized)
   {
    //Schema declaration
    TableSchema.Table schema = new TableSchema.Table("alertMessages", TableType.Table, DataService.GetInstance("kimAppProvider"));
    schema.Columns = new TableSchema.TableColumnCollection();
    schema.SchemaName = @"dbo";
    //columns

    TableSchema.TableColumn colvarMessageID = new TableSchema.TableColumn(schema);
    colvarMessageID.ColumnName = "messageID";
    colvarMessageID.DataType = DbType.Int32;
    colvarMessageID.MaxLength = 0;
    colvarMessageID.AutoIncrement = true;
    colvarMessageID.IsNullable = false;
    colvarMessageID.IsPrimaryKey = true;
    colvarMessageID.IsForeignKey = false;
    colvarMessageID.IsReadOnly = false;
    colvarMessageID.DefaultSetting = @"";
    colvarMessageID.ForeignKeyTableName = "";
    schema.Columns.Add(colvarMessageID);

    TableSchema.TableColumn colvarDocumentType = new TableSchema.TableColumn(schema);
    colvarDocumentType.ColumnName = "documentType";
    colvarDocumentType.DataType = DbType.AnsiString;
    colvarDocumentType.MaxLength = 50;
    colvarDocumentType.AutoIncrement = false;
    colvarDocumentType.IsNullable = false;
    colvarDocumentType.IsPrimaryKey = false;
    colvarDocumentType.IsForeignKey = false;
    colvarDocumentType.IsReadOnly = false;
    colvarDocumentType.DefaultSetting = @"";
    colvarDocumentType.ForeignKeyTableName = "";
    schema.Columns.Add(colvarDocumentType);

    TableSchema.TableColumn colvarMessageTitle = new TableSchema.TableColumn(schema);
    colvarMessageTitle.ColumnName = "messageTitle";
    colvarMessageTitle.DataType = DbType.AnsiString;
    colvarMessageTitle.MaxLength = 200;
    colvarMessageTitle.AutoIncrement = false;
    colvarMessageTitle.IsNullable = false;
    colvarMessageTitle.IsPrimaryKey = false;
    colvarMessageTitle.IsForeignKey = false;
    colvarMessageTitle.IsReadOnly = false;
    colvarMessageTitle.DefaultSetting = @"";
    colvarMessageTitle.ForeignKeyTableName = "";
    schema.Columns.Add(colvarMessageTitle);

    TableSchema.TableColumn colvarMsgPublishDate = new TableSchema.TableColumn(schema);
    colvarMsgPublishDate.ColumnName = "msgPublishDate";
    colvarMsgPublishDate.DataType = DbType.DateTime;
    colvarMsgPublishDate.MaxLength = 0;
    colvarMsgPublishDate.AutoIncrement = false;
    colvarMsgPublishDate.IsNullable = false;
    colvarMsgPublishDate.IsPrimaryKey = false;
    colvarMsgPublishDate.IsForeignKey = false;
    colvarMsgPublishDate.IsReadOnly = false;
    colvarMsgPublishDate.DefaultSetting = @"";
    colvarMsgPublishDate.ForeignKeyTableName = "";
    schema.Columns.Add(colvarMsgPublishDate);

    TableSchema.TableColumn colvarXml = new TableSchema.TableColumn(schema);
    colvarXml.ColumnName = "xml";
    colvarXml.DataType = DbType.String;
    colvarXml.MaxLength = 1073741823;
    colvarXml.AutoIncrement = false;
    colvarXml.IsNullable = false;
    colvarXml.IsPrimaryKey = false;
    colvarXml.IsForeignKey = false;
    colvarXml.IsReadOnly = false;
    colvarXml.DefaultSetting = @"";
    colvarXml.ForeignKeyTableName = "";
    schema.Columns.Add(colvarXml);

    TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema);
    colvarCreatedOn.ColumnName = "createdOn";
    colvarCreatedOn.DataType = DbType.DateTime;
    colvarCreatedOn.MaxLength = 0;
    colvarCreatedOn.AutoIncrement = false;
    colvarCreatedOn.IsNullable = false;
    colvarCreatedOn.IsPrimaryKey = false;
    colvarCreatedOn.IsForeignKey = false;
    colvarCreatedOn.IsReadOnly = false;
    colvarCreatedOn.DefaultSetting = @"";
    colvarCreatedOn.ForeignKeyTableName = "";
    schema.Columns.Add(colvarCreatedOn);

    TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema);
    colvarCreatedBy.ColumnName = "createdBy";
    colvarCreatedBy.DataType = DbType.String;
    colvarCreatedBy.MaxLength = 50;
    colvarCreatedBy.AutoIncrement = false;
    colvarCreatedBy.IsNullable = false;
    colvarCreatedBy.IsPrimaryKey = false;
    colvarCreatedBy.IsForeignKey = false;
    colvarCreatedBy.IsReadOnly = false;
    colvarCreatedBy.DefaultSetting = @"";
    colvarCreatedBy.ForeignKeyTableName = "";
    schema.Columns.Add(colvarCreatedBy);

    TableSchema.TableColumn colvarModifiedOn = new TableSchema.TableColumn(schema);
    colvarModifiedOn.ColumnName = "modifiedOn";
    colvarModifiedOn.DataType = DbType.DateTime;
    colvarModifiedOn.MaxLength = 0;
    colvarModifiedOn.AutoIncrement = false;
    colvarModifiedOn.IsNullable = true;
    colvarModifiedOn.IsPrimaryKey = false;
    colvarModifiedOn.IsForeignKey = false;
    colvarModifiedOn.IsReadOnly = false;
    colvarModifiedOn.DefaultSetting = @"";
    colvarModifiedOn.ForeignKeyTableName = "";
    schema.Columns.Add(colvarModifiedOn);

    TableSchema.TableColumn colvarModifiedBy = new TableSchema.TableColumn(schema);
    colvarModifiedBy.ColumnName = "modifiedBy";
    colvarModifiedBy.DataType = DbType.String;
    colvarModifiedBy.MaxLength = 50;
    colvarModifiedBy.AutoIncrement = false;
    colvarModifiedBy.IsNullable = true;
    colvarModifiedBy.IsPrimaryKey = false;
    colvarModifiedBy.IsForeignKey = false;
    colvarModifiedBy.IsReadOnly = false;
    colvarModifiedBy.DefaultSetting = @"";
    colvarModifiedBy.ForeignKeyTableName = "";
    schema.Columns.Add(colvarModifiedBy);

    BaseSchema = schema;
    //add this schema to the provider
    //so we can query it later
    DataService.Providers["kimAppProvider"].AddSchema("alertMessages",schema);
   }
  }
  #endregion

  #region Props

  PK Collections

        #endregion

        #region Deep Save

        #endregion
 }
}
#外部校验和(“d:\dscott\windows\visualstudio 2008\WebSites\KimV2\App_code\builder.abp”、“{406ea660-64cf-4c82-b6f0-42d4817a799}”、“ecaa88f7fa0bf610a5a26cf545dcd3a”)
使用制度;
使用系统文本;
使用系统数据;
使用System.Data.SqlClient;
使用System.Data.Common;
使用系统集合;
使用System.Collections.Generic;
使用系统组件模型;
使用系统配置;
使用System.Xml;
使用System.Xml.Serialization;
使用亚音速;
使用亚音速。实用程序;
命名空间数据
{
/// 
///AlertMessage类的强类型集合。
/// 
[可序列化]
公共部分类AlertMessageCollection:ActiveList
{    
公共AlertMessageCollection(){}
/// 
///根据设置的条件筛选现有集合。这是内存中的筛选器
///感谢开发克里斯!
/// 
///AlertMessageCollection
公共AlertMessageCollection筛选器()
{
对于(int i=this.Count-1;i>-1;i--)
{
AlertMessage o=此[i];
foreach(亚音速,其中w在这里,Where在这里)
{
bool-remove=false;
System.Reflection.PropertyInfo pi=o.GetType().GetProperty(w.ColumnName);
if(pi.CanRead)
{
object val=pi.GetValue(o,null);
开关(w.比较)
{
情况亚音速。比较。等于:
如果(!val.Equals(w.ParameterValue))
{
移除=真;
}
打破
}
}
如果(删除)
{
本条。删除(o);
打破
}
}
}
归还这个;
}
}
/// 
///这是一个封装alertMessages表的ActiveRecord类。
/// 
[可序列化]
公共部分类警报消息:ActiveRecord、IActiveRecord
{
#region.ctors和默认设置
公共警报消息()
{
SetSQLProps();
InitSetDefaults();
MarkNew();
}
私有void InitSetDefaults(){SetDefaults();}
公共警报消息(bool useDatabaseDefaults)
{
SetSQLProps();
如果(使用数据库默认值)
强制默认值();
MarkNew();
}
公共警报消息(对象密钥ID)
{
SetSQLProps();
InitSetDefaults();
LoadByKey(keyID);
}
公共警报消息(字符串columnName、对象columnValue)
{
SetSQLProps();
InitSetDefaults();
LoadByParam(columnName、columnValue);
}
受保护的静态void SetSQLProps(){GetTableSchema();}
#端区
#区域模式和查询访问器
公共静态查询CreateQuery(){返回新查询(架构);}
公共静态表模式。表模式
{
得到
{
if(BaseSchema==null)
SetSQLProps();
返回BaseSchema;
}
}
私有静态void GetTableSchema()
{
如果(!IsSchemaInitialized)
{
//模式声明
TableSchema.TableSchema=新的TableSchema.Table(“alertMessages”,TableType.Table,DataService.GetInstance(“kimAppProvider”);
schema.Columns=new TableSchema.TableColumnCollection();
schema.SchemaName=@“dbo”;
//纵队
TableSchema.TableColumn colvarMessageID=新的TableSchema.TableColumn(模式);
colvarMessageID.ColumnName=“messageID”;
colvarMessageID.DataType=DbType.Int32;
colvarMessageID.MaxLength=0;
colvarMessageID.AutoIncrement=true;
colvarMessageID.IsNullable=false;
colvarMessageID.IsPrimaryKey=true;
colvarMessageID.IsForeignKey=false;
colvarMessageID.IsReadOnly=false;
colvarMessageID.DefaultSetting=@;
colvarMessageID.ForeignKeyTableName=“”;
schema.Columns.Add(colvarMessageID);
TableSchema.TableColumn colvarDocumentType=新的TableSchema.TableColumn(模式);
colvarDocumentType.ColumnName=“documentType”;
colvarDocumentType.DataType=DbType.AnsiString;
colvarDocumentType.MaxLength=50;
colvarDocumentType.AutoIncrement=false;
colvarDocumentType.IsNullable=false;
colvarDocumentType.IsPrimaryKey=false;
colvarDocumentType.IsForeignKey=false;
colvarDocumentType.IsReadOnly=false;
colvarDocumentType.DefaultSetting=@”;
colvarDocumentType.ForeignKeyTableName=“”;
schema.Columns.Add(colvarDocumentType);
TableSchema.TableColumn colvarMessageTitle=新的TableSchema.TableColumn(模式);
colvarMessageTitle.ColumnName=“messageTitle”;
colvarMessageTitle.DataType=DbType.AnsiString;
colvarMessageTitle.MaxLength=200;
colvarMessageTitle.AutoIncrement=false;
colvarMessageTitle.IsNullable=false;
colvarMessageTitle.IsPrimaryKey=false;
colvarMessageTitle.IsForeignKey=false;
科尔夫
<compilation debug="true" defaultLanguage="C#">
      <!--########################## SubSonic Build Provider ###############################-->
      <!--This will NOT WORK in Medium Trust-->
      <buildProviders>
        <add extension=".abp" type="SubSonic.BuildProvider, SubSonic"/>
      </buildProviders>
    <compilation debug="true" defaultLanguage="VB">