This question is locked. New answers and comments are not allowed.
Hi, ive got and error and dont know how to fix it, mine code is:
but i got all the time:
Transaction was terminated before result set is discarded
(Telerik.OpenAccess.Exceptions.UnsupportedException)
The funniest thing is when the query get only like 5 items its working, but when i got lik 200 its not, and i dont know how to fix this.
IObjectScope scope = DBProvider.GetNewObjectScope();
var messageQuery = from m
in
scope.Extent<Messageaccess>()
where m.UsersLOGIN.Equals(Settings.UserLogin)
&& m.ShowAlert == Enums.YesNo.Yes
&& m.Message.Type == Enums.MessageType.Email
select m;
int
messageCount = messageQuery.Count();
if
(messageCount > 0)
{
int
x = 0;
string
content =
string
.Empty;
foreach
(Messageaccess messageAccess
in
messageQuery)
{
if
(x == 0)
{
content =
"<html><b>"
+ messageAccess.Message.Sender +
"</b><br><i>"
+ messageAccess.Message.Subject +
"</i></html>"
;
}
InvokeFunc(messageAccess.Type, messageAccess.Status, messageAccess.SubFolder,
false
);
scope.Transaction.Begin();
messageAccess.ShowAlert = Enums.YesNo.No;
try
{
scope.Transaction.Commit();
}
catch
(Exception ex)
{
scope.Transaction.Rollback();
}
x++;
}
scope.Dispose();
but i got all the time:
Transaction was terminated before result set is discarded
(Telerik.OpenAccess.Exceptions.UnsupportedException)
The funniest thing is when the query get only like 5 items its working, but when i got lik 200 its not, and i dont know how to fix this.