ado.net 的 syn 问题

发布于 2024-10-11 06:08:18 字数 1720 浏览 3 评论 0原文

我有一种通过存储过程添加投资状态的方法(在这种方法中,我检查实际状态并将其插入表中)

public void AddStatusInvestment(InvestmentData.InvestmentRow Investment, InvestmentData ds, DictionaryData dict)
            {
            SomeMethodWHichUsesStoredProcedureWithActualStatus();
                     var statInw = PhaseStatusHelper.GetStatusesInvestment(Investment, ds);
            }

当我检查数字时,我没有看到任何变化:

var statInw = PhaseStatusHelper.GetStatusesInvestment(Investment, ds);

 public static List<InvestmentData.StatusesInvestmentRow> GetStatusesInvestment(InvestmentData.InvestmentRow Investment, InvestmentData ds)
        {
            List<InvestmentData.StatusesInvestmentRow> Statuses = 
             new List<InvestmentData.StatusesInvestmentRow>();


        Statuses.AddRange(Investment.GetStatusesInvestmentRows());

        return Statuses;
    }

这是设计者的代码:

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
        public StatusesInvestmentRow[] GetStatusesInvestmentRows() {
            if ((this.Table.ChildRelations["FK_Investment_StatusesInvestment"] == null)) {
                return new StatusesInvestmentRow[0];
            }
            else {
                return ((StatusesInvestmentRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Investment_StatusesInvestment"])));
            }
        }

StatusesInvestment 表:

InvestmentId int
EnumStatusesInvestment int
StatusesInvestmentId int PK

我能做什么获得正确的状态数量

当我再次启动我的应用程序时,投资状态的数量是正确的

I have a method which adds investment status by storedprocedure (in this method I check what actual status is and insert it to table)

public void AddStatusInvestment(InvestmentData.InvestmentRow Investment, InvestmentData ds, DictionaryData dict)
            {
            SomeMethodWHichUsesStoredProcedureWithActualStatus();
                     var statInw = PhaseStatusHelper.GetStatusesInvestment(Investment, ds);
            }

When I check number I don't see any change:

var statInw = PhaseStatusHelper.GetStatusesInvestment(Investment, ds);

 public static List<InvestmentData.StatusesInvestmentRow> GetStatusesInvestment(InvestmentData.InvestmentRow Investment, InvestmentData ds)
        {
            List<InvestmentData.StatusesInvestmentRow> Statuses = 
             new List<InvestmentData.StatusesInvestmentRow>();


        Statuses.AddRange(Investment.GetStatusesInvestmentRows());

        return Statuses;
    }

Here is code from designer:

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
        public StatusesInvestmentRow[] GetStatusesInvestmentRows() {
            if ((this.Table.ChildRelations["FK_Investment_StatusesInvestment"] == null)) {
                return new StatusesInvestmentRow[0];
            }
            else {
                return ((StatusesInvestmentRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Investment_StatusesInvestment"])));
            }
        }

StatusesInvestment table:

InvestmentId int
EnumStatusesInvestment int
StatusesInvestmentId int PK

What can I do to get correct number of statuses

When I launch my application again number of investment statuses is correct

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

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

发布评论

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

评论(1

听,心雨的声音 2024-10-18 06:08:18

您可能在调用存储过程后没有刷新数据集。
数据集保存其数据的本地副本,并且不会自动更新。

You probably didn't refresh the dataset after calling the stored procedure.
A dataset holds a local copy of its data and doesn't update automatically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文