English 中文(简体)
三年级图书馆和成绩
原标题:Subsonic 3 Class Library & Winforms App Null IDataProvider BUG

我有一个类库项目和一个WinForms应用程序。

一切都在很好地生成,我的Winforms应用程序引用了类库,但是一旦我运行它并尝试检索数据,它就会显示数据提供程序为空。

需要注意的是,我的Winforms应用程序中没有app.config文件,只有在类库中有。我需要在Winforms应用程序中有一个吗?如果需要,我应该在其中放什么?

增 编

更新:我认为在QuerySelect.cs中发现了一个错误。

    public Select(IDataProvider provider, params string[] columns)
    {
        //_provider is null
        //provider is populated correctly
        this.sqlFragment = new SqlFragment(_provider);
        _provider = provider;
        SelectColumnList = columns;
        SQLCommand = this.sqlFragment.SELECT;
    }
问题回答

是的,您需要在您的Winforms应用程序中使用一个App.config文件,并将连接字符串放置在那里。值得注意的是,在类库中使用App.config是没有意义的,除非您正在使用SubSonic,这将从项目中提取一个App.config文件。

类库没有自己的配置 - 它们从执行环境中提取它们的配置。





相关问题
Debugging SQL in ASP.NET

private void BuildGridView2() { GridView1.DataSource = new Select() .From("NewsReleases") .Where("RelMonth").IsEqualTo(this.ddlAward.SelectedValue) .And("RelYear").IsEqualTo(this....

SubSonic Error with MySql CONVERT()

I has encountered conversion from integer to string with MySql+SubSonic3 (it generates wrong SQL query). After I found root of the problem in SubSonic sources and fixed it, everything works fine, but ...

SubSonic OpenExpression/CloseExpression

Hey All! I m trying to construct a query that is something like this: Where column = "value" AND column2 = "value" AND (column3 = "value" OR column4 = "value") I have this code: return new Select() ...

Grouping with SubSonic 3

I have the following table "GroupPriority": Id Group Priority 1 1 0 2 2 0 3 3 0 4 2 1 5 1 1 6 2 2 7 ...

Subsonic Linq guid problem

The construtor Void .ctor(System.Guid, Int32) is not supported. this error occured with the following statements: var Test = from r in db.UserRoles join p in db.UserPermissions on new { r....

热门标签