trunk/src/LythumOSL.Core/Data/Helpers.cs
/// <summary>
/// Used for only typical dictionary datatables,
/// where first column is id, and 2nd column is name
/// 
/// This method copies all DataTable and adds 1st column
/// </summary>
/// <param name="sourceTable"></param>
/// <param name="id"></param>
/// <param name="name"></param>
/// <returns></returns>
Used for only typical dictionary datatables,
where first column is id, and 2nd column is name

This method copies all DataTable and adds 1st column
Used for only typical dictionary datatables where first column is id and 2nd column is name This method copies all DataTable and adds 1st column
public static DataTable CraftDictionaryTable (
			DataTable sourceTable,
			object id,
			object name)
		{
			DataTable retVal = sourceTable.Copy ();
			DataRow r = retVal.NewRow ();
			r[0] = id;
			r[1] = name;
			retVal.Rows.InsertAt (r, 0);
			retVal.AcceptChanges ();
			return retVal;
		}
public static DataTable CraftDictionaryTable ( DataTable sourceTable , object id , object name ) { DataTable retVal = sourceTable . Copy ( ) ; DataRow r = retVal . NewRow ( ) ; r [ 0 ] = id ; r [ 1 ] = name ; retVal . Rows . InsertAt ( r , 0 ) ; retVal . AcceptChanges ( ) ; return retVal ; }
Used for only typical dictionary datatables,
where first column is id, and 2nd column is name
Used for only typical dictionary datatables where first column is id and 2nd column is name
None
sourceTable
DataTable
None
id
object
None
name
object
None