The Situation: You have a DevExpress ASPxGridLookup control on your page and need to update its contents when some event occurs (such as a parent drop-down value changes). The problem is that the ASPxGridLookup control does not implement an OnCallback event. A Solution: First of all, this is not my solution. I found it on … Continue reading How To Perform a Callback on an ASPxGridLookup Control
Author: Jim McMullen
How to Split a String into a Generic List Rather Than an Array
The Situation You want to split a string, but the C# split() function returns a string[] array. You want a List<string> instead. A Solution If you are using .Net 3.5 or later, use Linq extensions:
How to Convert a Generic List to a Comma-Delimited List
The Situation: You have a List<string> and need to convert it to a comma-delimited list (for display or storage). A Solution: This is a great example of how C# has improved over the years. I found this solution in this StackOverflow discussion and don't want to lose it, so I am copying it here for … Continue reading How to Convert a Generic List to a Comma-Delimited List
How to Add a New Table to an Existing Database via EF Code-First Migrations
The Situation: You have been using Entity Framework code-first migrations with an existing database. Making changes to an existing table, such as adding a new field, go smoothly, and the database is updated correctly when you run an "Update-database" command. However, when you create an entirely new entity in your model and run "Update-database", the … Continue reading How to Add a New Table to an Existing Database via EF Code-First Migrations
How to Enable and Use EF Code-First Migrations for Multiple Contexts
The Situation You want to use Entity Frameworks code-first migrations to push model changes to the database, but you have multiple databases and contexts in your model. When you try to run Enable-Migrations for the second context, you get an error that looks like this: Migrations have already been enabled in project 'Project1'. To overwrite the … Continue reading How to Enable and Use EF Code-First Migrations for Multiple Contexts