I am converting the following Entity Framework on .NET 4.7.2 code to run on .NET 8.
var item = new Form
{
TokenId = System.Guid.NewGuid().ToString(),
BillForm = "B",
CompanyNumber = 5,
PolicyNumber = "11111111111"
};
_formRepository.Add(item);
_formRepository.Execute("Call ProgramLibrary.CLProgram");
.NET 8
var item = new Form
{
TokenId = System.Guid.NewGuid().ToString(),
BillForm = "B",
CompanyNumber = 5,
PolicyNumber = "11111111111"
};
context._formRepository.Add(item);
var result = context.Database.ExecuteSqlRaw("Call ProgramLibrary.CLProgram");
Connection string:
"AS400Entities": "server=servername;uid=userid;pwd=pasword;database=databasename;Isolation Level=Chaos;"
I am able to access AS400 tables in .NET 8 and update the data, but the CL program is not being executed. The result is returning -1, which indicates failure.
Do you know what I might be missing?
I am converting the following Entity Framework on .NET 4.7.2 code to run on .NET 8.
var item = new Form
{
TokenId = System.Guid.NewGuid().ToString(),
BillForm = "B",
CompanyNumber = 5,
PolicyNumber = "11111111111"
};
_formRepository.Add(item);
_formRepository.Execute("Call ProgramLibrary.CLProgram");
.NET 8
var item = new Form
{
TokenId = System.Guid.NewGuid().ToString(),
BillForm = "B",
CompanyNumber = 5,
PolicyNumber = "11111111111"
};
context._formRepository.Add(item);
var result = context.Database.ExecuteSqlRaw("Call ProgramLibrary.CLProgram");
Connection string:
"AS400Entities": "server=servername;uid=userid;pwd=pasword;database=databasename;Isolation Level=Chaos;"
I am able to access AS400 tables in .NET 8 and update the data, but the CL program is not being executed. The result is returning -1, which indicates failure.
Do you know what I might be missing?
Share Improve this question edited Mar 11 at 16:17 marc_s 756k184 gold badges1.4k silver badges1.5k bronze badges asked Mar 11 at 14:48 NakresNakres 1,6521 gold badge15 silver badges30 bronze badges 2 |1 Answer
Reset to default 0SaveChanges was missing. That was the issue. It is now working. Result still returns -1 but it executes the CL program.
context._formRepository.Add(item);
context.SaveChanges();
var result = context.Database.ExecuteSqlRaw("Call ProgramLibrary.CLProgram");
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744787262a4593701.html
_formRepository.Execute("Call ProgramLibrary.CLProgram");
vscontext.Database.ExecuteSqlRaw("Call ProgramLibrary.CLProgram");
? Is there some error logged on the db system? – Fildor Commented Mar 11 at 14:59