Har du kollat på LinqDataSource? Här är en bra guide. http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx
Frågan#1
Hej!
Har precis gett mig på att testa och labba lite med LINQ men får inte riktigt till det när jag skall uppdatera datan i en GridView.
public void getUsersCategoryToGridView()
{
if (Context.User.Identity.IsAuthenticated)
{
try
{
linqUsersDataContext db = new linqUsersDataContext();
var query = from c in db.categories
where c.UserId == ((Guid)Membership.GetUser().ProviderUserKey)
select new { c.category1, c.expense };
GridViewCategories.DataSource = query;
GridViewCategories.DataBind();
}
catch { }
}
}
här var det tomt:
protected void GridViewCategories_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
}
