Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't Convert byte[] to Binary in Linq
    text
    copied!<p>I am working on Linq Query through the ObservableCollection, but I am not able to convert type binary to byte[].</p> <p>my code is like this.</p> <pre><code>q1 = (from a in Helper.db.AccountStatement join b in Helper.db.BankAccount on a.BankAccId equals b.BankAccId join c in Helper.db.BankBranch on b.BankBranchId equals c.BankBranchId join d in Helper.db.Bank on c.BankId equals d.BankId where b.AccType == stracctype &amp;&amp; b.UserId == intuserid &amp;&amp; a.ActiveStatement == true &amp;&amp; b.ActiveAccount == true group new { b, d, a } by new { b.BankAccId, d.Name, b.AccNumber } into h select new BankSummaryDataGrid { BankAccId = h.Key.BankAccId, byteLogo = Convert.FromBase64String(d.VectorLogo.ToString().Replace("\"", "")), BankName = h.Key.Name, AccountNumber = h.Key.AccNumber, ClosingBalance = ((h.Where(p =&gt; p.a.TxtType == HMBL.WealthManager.WMCoAEntities.clsTransactionType.strDr).Sum(p =&gt; p.a.TxnAmt) == null ? 0.0 : h.Where(p =&gt; p.a.TxtType == HMBL.WealthManager.WMCoAEntities.clsTransactionType.strDr).Sum(p =&gt; p.a.TxnAmt)) - (h.Where(p =&gt; p.a.TxtType == HMBL.WealthManager.WMCoAEntities.clsTransactionType.strCr).Sum(p =&gt; p.a.TxnAmt) == null ? 0.0 : h.Where(p =&gt; p.a.TxtType == HMBL.WealthManager.WMCoAEntities.clsTransactionType.strCr).Sum(p =&gt; p.a.TxnAmt))) }).ToList(); </code></pre> <p>BankSummaryDataGrid is the Class of ObservableCollection. so the I am getting error like this.</p> <blockquote> <p>There was an error parsing the query. [ Token line number = 19,Token line offset = 41,Token in error = MAX ]</p> </blockquote> <p>byteLogo is the type of the byte[].!</p> <blockquote> <p>System.Data.SqlServerCe.SqlCeException was caught Message=There was an error parsing the query. [ Token line number = 19,Token line offset = 41,Token in error = MAX ] Source=SQL Server Compact ADO.NET Data Provider HResult=-2147217900 NativeError=25501 StackTrace: at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan() at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) at System.Data.Linq.DataQuery<code>1.System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator() at System.Collections.Generic.List</code>1..ctor(IEnumerable<code>1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable</code>1 source) at HMBL.Bank.GetBankSummary(Int32 intuserid, String stracctype) in E:\Working Folder 2011\MoneyCubePlus\Source\HMBL\TransactionManager\Transaction.cs:line 993 InnerException: </p> </blockquote> <p>Thanks...!!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload