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
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.