The Blog of Travis Gneiting
  • Home
KEEP IN TOUCH

Posts in category Uncategorized

Get a Copyiable list of fields from a table

Aug10
2010
Leave a Comment Written by admin

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’

Eager Loading in Entity Framework

Aug08
2010
Leave a Comment Written by admin

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

MS Build for ASP.NET Website

Jul19
2010
3 Comments Written by admin

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

Get value asp:Textbox value using javascript

Jul12
2010
Leave a Comment Written by admin

Here are a few ways to get the value of an asp textbox

  1. document.getElementById(‘<%=Test.ClientID%>’).value
  2. <%=txtMyTextBox.ClientID%>
  3. Response.Redirect(“Form2.aspx?name=” + txtName.Text + “&num=” + txtStNum.Text );

Quick way to convert a generic list to a CSV using String.Join

May25
2010
Leave a Comment Written by admin

String.Join(“,”,Array.ConvertAll(list.ToArray(),element => element.ToString()));

Entity Framework – How to add new object

Mar31
2010
Leave a Comment Written by admin

For entity framework, you should use ObjectContext.AddObject() instead of Linq to SQL DataContext.TableName.Add()

Microsoft Suggested Naming Conventions

Feb24
2010
1 Comment Written by admin

http://msdn.microsoft.com/en-us/library/ms229002.aspx

Entity Framwork Query Examples

Feb24
2010
Leave a Comment Written by admin
var selectCustomer = from c in dbContext.Customer.Include(“Invoice.Product”)
where c.Id == id
select c

Microsoft Certified Technology Specialist (MCTS)

Feb11
2010
Leave a Comment Written by admin

http://www.microsoft.com/learning/en/us/certification/mcts.aspx#tab3

Use PRG pattern for data modification

Feb10
2010
Leave a Comment Written by admin

Use PRG pattern for data modification

“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.”

« Older Entries Newer Entries »

Programming

  • ASP.NET
  • MSDN
  • Visual Studio Offical Website
  • www.w3.org

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Welcome to My Programming Blog

This is my brain dump. I use it to post thing I may use again, interesting things I have run into and programming helps.

Tags

.net Agile Software Development Engineering ASP.NET attack Beginner Blueprint CSS Database Deployment DevExpress Framework Functional hacked Hotmail How to test software HTTP IIS Javascript JQuery MIME New Website Checklist PHP querystring Software Testing Specification spoof Status Codes Testing Trace Debug ASP.NET Tutorial Velocity webmethod Website Testing Zend

Blog Archive

  • January 2012
  • November 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • February 2011
  • January 2011
  • November 2010
  • October 2010
  • August 2010
  • July 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • February 2009
  • January 2009
  • November 2008
  • September 2008
  • August 2008
  • July 2008
  • April 2008

EvoLve theme by Theme4Press  •  Powered by WordPress The Blog of Travis Gneiting