Moses Yap
:-) A happy IT Guy

C#: Getting a Random Record from a Table inside the SQL Server Database

July 30, 2008 03:56 by moses.yap
I wanted to get a random record from a particular table on the SQL Server database.  For my case, I had a table containing quotes, and I wanted to randomly pick on to show on one corner of my web site.  I am also using LINQ to SQL for this web site, so the solution here will be using LINQ,... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: .NET | C# | SQL Server | Lamda
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

LINQ: A pretty interesting LINQ usage

June 30, 2008 13:22 by moses.yap
I was having a problem doing something very simple.  I wanted to bind an array of string to a DataGridView on a windows program, but instead of the values of the strings in the array, I am getting the Length instead.  I guess that is because the Length is the first public property and this... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: .NET | C# | Lamda
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

C#: Converting an Array of String to an Array of int

May 1, 2008 17:32 by MosesYap
This post is about converting an array of a particular datatype to another array of a different type.  The title is a bit misleading in that the procedures described below can be used to convert from an array of any datatype to an array of any datatype.Converting a delimited string to an int ar... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: .NET | Lamda | C#
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Using LINQ for SQL

April 7, 2008 14:03 by MosesYap
I've just finished creating a very simple site for my wife about her mission trip to Cambodia.  She went to Cambodia twice last year (2007) to help out with some charity work.  Our Church, Saint Andrews Cathedral had a student center in Kampong Speu.  For more information about ... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: .NET | Lamda | C#
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Using Lamda to join between two ActiveRecord Collection

April 2, 2008 16:33 by MosesYap
Here is an example where you can join two ActiveRecord collections in memory. Actually, this example applies to any object collection. In this example, we have a ProjectCollection and a ProjectMemberCollection. The ProjectCollection contains a collection of Project objects with ProjectID a... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: .NET | Lamda | C#
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Getting a comma delimited string from any collection with Lamda Expression

March 26, 2008 16:13 by admin
Here is a pretty useful routine when you have a collection in memory and you want to go through the collection and come out with a comma delimited string. For this example, we have a List<int>             List<int> keys = ...;  &nb... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: .NET | Lamda | C#
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed