Subsonic 3.0 与 winform 应用程序

发布于 2024-09-19 11:11:05 字数 370 浏览 3 评论 0原文

subsonic 3.0可以与winform应用程序一起使用吗?我需要添加对 system.web 的任何引用吗?

如果可以的话,如何排除数据库中的某些表?我可以使用我用于亚音速 2.0 的以下内容吗

<providers>
  <!--<clear/>-->
  <add name="TEST" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="myString" includeTableList="CustomerReference" includeProcedureList=""/>
</providers>

Can subsonic 3.0 be used with a winform app? Do I need to add any references to the system.web?

If it can be done, how can I exclude certain tables in the DB? Can I use the following whih I am using for subsonic 2.0

<providers>
  <!--<clear/>-->
  <add name="TEST" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="myString" includeTableList="CustomerReference" includeProcedureList=""/>
</providers>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一瞬间的火花 2024-09-26 11:11:05

你可以使用它!无需包含 System.web。但是您失去了脚手架工具(除非您专门创建一个 Web 应用程序来使用这些工具并与桌面应用程序共享数据库)。
对于排除表,您必须修改 Settings.ttinclude,在 Settings.ttinclude 的以下部分(第 30 行)中:

//this is a list of tables you don't want generated
string[] ExcludeTables = new string[]{
"sysdiagrams",
"BuildVersion",
};

我从未使用过 Subsonic 2,但我认为数据提供程序的 XML 定义有点不同。

例如,这就是我正在使用的:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
   <!-- SQLite -->
    <add name="Test"
         providerName="System.Data.SQLite"
         connectionString="Data Source = C:\Database.db;Version=3"/>
  </connectionStrings>
</configuration> in

You can use it!. There is no need to include System.web. But you lose the scaffolding tools (except that you make a web application specifically to use the tools and share a DB with the desktop app).
And for excluding tables, you have to modify Settings.ttinclude, in the following section (line 30) in Settings.ttinclude:

//this is a list of tables you don't want generated
string[] ExcludeTables = new string[]{
"sysdiagrams",
"BuildVersion",
};

I never used Subsonic 2, buth I think that the XML definitions for the data providers are a little different.

For example, this is what I'm using:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
   <!-- SQLite -->
    <add name="Test"
         providerName="System.Data.SQLite"
         connectionString="Data Source = C:\Database.db;Version=3"/>
  </connectionStrings>
</configuration> in
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文