Update using LINQ to SQL

LINQ is a query tool (Q = Query) – so there is no magic LINQ way to update just the single row, except through the (object-oriented) data-context (in the case of LINQ-to-SQL). To update data, you need to fetch it out, update the record, and submit the changes: using(var ctx = new FooContext()) { var … Read more

Tradeoffs using NHibernate 3.0 QueryOver or LINQ provider

LINQ and QueryOver are completely different query methods, which are added to the ones that existed in NHibernate 2 (Criteria, HQL, SQL) QueryOver is meant as a strongly-typed version of Criteria, and supports mostly the same constructs, which are NHibernate-specific. LINQ is a “standard” query method, which means the client code can work on IQueryable … Read more

Updating your edmx to reflect changes made in your db (.net linq-to-entities)

Update/delete from the EDMX is not always functional. If the model doesn’t get updated on clicking Update Model from Database let’s say when you have updated a view/table in the DB, do the following: 1) Delete the view/table from the model diagram 2) Switch the EDMX to xml view (right click the edmx file and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)