Linq.Binary vs. LinqDatasource vs. ListView

R

Rasmus

I have a simple LiveView control that databinds to a LinqDataSource that maps
to a table like this:

CREATE TABLE MyTable
(Id int NOT NULL,
Name nvarchar(50) NULL,
Picture image NULL)

The OR mapper class (made in the VS 2008 designer) has a property of type
System.Data.Linq.Binary

When editing (and clicking update) a row in the listview i get this error:

"Failed to set one or more properties on type MyTable. Ensure that the
input values are valid and can be converted to the corresponding property
types. "

Inspecting inner execptions i see:

"Cannot convert value of parameter 'Picture' from 'System.String' to
'System.Data.Linq.Binary'."

Looking more into the ListViewUpdateEventArgs on the protected void
ListView1_ItemUpdating(object sender, ListViewUpdateEventArgs e) method i
notice:

Picture
e.NewValues["Picture"] {"AAAAAAAA=="} object{System.Data.Linq.Binary}
e.OldValues["Picture"] "\"AAAAAAAA==\"" object {string}

Can you make this work?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top