views:

231

answers:

1

Hi Chaps,

I use a DeatialsView with AutoGeberateColoums for my user administration.

Here my start code:

        Business.UserHandling uh = new Business.UserHandling();
        DAL.Benutzer user = uh.GetSingleUser(BenutzerID_Int);
        List<DAL.Benutzer> listUser = new List<DAL.Benutzer>();
        listUser.Add(user);
        DetailsView1.DataSource = listUser;
        DetailsView1.DataBind();

How can I save it automaticly without must assigning every field from the view to an object field?

Please be aware, I have different projects to cut the ASP-Layer from the Data Layer, so I must only have an "Benutzer"-Object, I can't use LinQ directly here.

(P.s.: I musst add the "Benutzer"-Object to a list, because the DetailsView won't have a single object, if someone knows it better, please correct me).

+2  A: 

try to bind your detailsview to linqdatasource and it will automatically update linq object

Muhammad Akhtar