A fast way to get a list you can copy into a code file with all the fields in a table.
select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = ‘tablename’
A fast way to get a list you can copy into a code file with all the fields in a table.
select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = ‘tablename’
Entity Framework (EF) does not support lazy loading. You must explicitly load the comments advising the EF what to include.
Using ctx as new MyDataContext()
lvComments.DataSource = ctx.Entity.Include(“SomethingToInclude”).First().Comments
lvComments.Databind()
End Using
Or
Using ctx as new MyDataContext()
Dim MyListOfSomething as List(of ListOfSomething) = ctx.ListOfSomething
MyListOfSomething.SomethingToLoad.Load()
lvComments.DataSource = MyListOfSomething.Comments
lvComments.DataBind()
End Using
The problem: no .csproj file in websites
The solution: http://www.dotnetsizzler.com/post/Using-MS-Build-in-ASPNET-Website.aspx Add a proj file to the website, and set up the build to use it. http://en.csharp-online.net/MSBuild:_By_Example%E2%80%94Dealing_with_MSBuild_Errors
String.Join(“,”,Array.ConvertAll(list.ToArray(),element => element.ToString()));
For entity framework, you should use ObjectContext.AddObject() instead of Linq to SQL DataContext.TableName.Add()
var selectCustomer = from c in dbContext.Customer.Include(“Invoice.Product”) where c.Id == id select c
“PRG stands for Post-Redirect-Get to avoid the classic browser warning when refreshing a page after post. Whenever you make a POST request, once the request complets do a redirect so that a GET request is fired. In this way when the user refresh the page, the last GET request will be executed rather than the POST thereby avoiding unnecessary usability issue.”