Re: WPF/LinqToSql/DataGrid

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On May 6, 2:12 pm, Bill McCormick <wpmccorm...@xxxxxxxxxxxxxxxx>
wrote:
Selecting certain rows of data from my WPF datagrid (bound to a
LinqToSQL datasource) are generating exceptions that I'm not sure how to
handle.

It's a FormatException with message: String must be exactly one
character long, but I can't tell what it is about these records that is
causing the problem.

The only info I know how to get is the stack trace (below) and it's not
helping me.
[snip]

Looking at the stack trace, I have a strong feeling that WPF is not
even relevant here. What happens when you use the exact same LINQ
query and just enumerate the result completely, without databinding it
to anything?

I think what happens is that you have a divergence between your LINQ
to SQL-generated C# classes, and the database schema. Your class
probably has a "char" field, and the corresponding field of the table
contains strings that are longer than a single char.
.



Relevant Pages

  • Re: JSP format number
    ... This is the stack trace I'm getting and the code that is causing it is ... I solved my formatting class another way. ... getting a number when he is expecting a String. ... NumberFormat, on the other hand, allows you to parse ...
    (comp.lang.java.help)
  • Re: =?ISO-8859-15?Q?Unerkl=E4rliches_Verhalten_von_Array=2E?= =?ISO-8859-15?Q?Except
    ... Duplikate zurückgibt. ... In der Doku steht leider nicht drin, ... Linq aus der SQL-Ecke. ... public static string Clean ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: find closest item in keyed collection
    ... One-way searches are fortunately easier than 2-way proximity... ... If this is volume usage, then the LINQ approach I posted earlier would ... KeyValuePair<int, string> result = ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Load Testing Errors
    ... > An unhandled exception was generated during the execution of the current web ... > be identified using the exception stack trace below. ... > System.Web.UI.DataBinder.GetPropertyValue(Object container, String ... > propName, String format) +11 ...
    (microsoft.public.dotnet.framework.performance)
  • RE: Load Testing Errors
    ... > An unhandled exception was generated during the execution of the current web ... > be identified using the exception stack trace below. ... > System.Web.UI.DataBinder.GetPropertyValue(Object container, String ... > propName, String format) +11 ...
    (microsoft.public.dotnet.general)