ado.net 的 syn 问题
我有一种通过存储过程添加投资状态的方法(在这种方法中,我检查实际状态并将其插入表中)
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能在调用存储过程后没有刷新数据集。
数据集保存其数据的本地副本,并且不会自动更新。
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.