If you have good debugging skill then you can save lots of time. In visual studio lots of options are available for debugging.
Here are some good URL for debugging. It will be really useful in our daily working project.
http://geekswithblogs.net/sdorman/archive/2009/02/14/visual-studio-2008-debugging-ndash-the-watch-window.aspxDebugging in loop
Debugging in Store Procedure
I hope it will help to someone
Now in EF 5.0 i.e in VS 2011 default supporting the “Precompile
query”. Previously this feature was not
there in EF. It will really give very good performance. Now no need to write
any code for this functionality.
Just now, i tested
the code, We can also disable this feature like this.
protected void Page_Load(object sender, EventArgs e)
using (var db = new TestEntities())
This line of code is used to disable the autocompile query
db.ContextOptions.DefaultQueryPlanCachingSetting = false;
var query = db.tblEmps.Select(m => m);
GridView1.DataSource = query;
property was not there in previous
I was doing some test with code first approach in EF. Then while populating the Gridview i was getting error like thisData
binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not
supported. Instead populate a DbSet with data, for example by calling
Load on the DbSet, and then bind to local data. For WPF bind to
DbSet.Local. For WinForms bind to DbSet.Local.ToBindingList().
For solving this error we have to write the code like this
private void FillGrid()
using (var Context = new EmpDatabaseContext())
var query = Context.Emps.Select(m => m);
//var query = from m in Context.Emps
// select m;
// Gridview1.DataSource = query; Gridview1.DataSource = query.ToList();
We canot bind Iqueryable directly. We have to change into ToList()