DataUtils Class
Utility library for common data operations.
Westwind.Utilities.DataUtils
Class Members
| Member | Description | |
|---|---|---|
| CopyDataRow | Copies the content of a data row to another. Runs through the target's fields and looks for fields of the same name in the source row. Structure must mathc or fields are skipped.
public static bool CopyDataRow(DataRow source, DataRow target)
|
|
| CopyObjectData | Copies the data of one object to another. The target object 'pulls' properties of the first. This any matching properties are written to the target. The object copy is a shallow copy only. Any…
public static void CopyObjectData(object source, object target)
|
|
| CopyObjectFromDataRow | Populates an object passed in from values in a data row that's passed in.
public static void CopyObjectFromDataRow(DataRow row, object targetObject,
MemberInfo[] cachedMemberInfo)
|
|
| CopyObjectToDataRow | Copies the content of an object to a DataRow with matching field names. Both properties and fields are copied. If a field copy fails due to a type mismatch copying continues but the method returns…
public static bool CopyObjectToDataRow(DataRow row, object target)
|
|
| DataReaderToIEnumerable |
public static IEnumerable
|
|
| DataReaderToList |
public static List
|
|
| DataReaderToObject | Populates the properties of an object from a single DataReader row using Reflection by matching the DataReader fields to a public property on the object passed in. Unmatched properties are left…
public static void DataReaderToObject(IDataReader reader, object instance,
string propertiesToSkip, Dictionary
|
|
| DataReaderToObjectList |
public static List
|
|
| DataTableToObjectList |
public static List
|
|
| DataTableToTypedList |
public static List
|
|
| DbTypeToDotNetType | Maps a DbType to a .NET native type
public static Type DbTypeToDotNetType(DbType sqlType)
|
|
| DotNetTypeToDbType | Converts a .NET type into a DbType value
public static DbType DotNetTypeToDbType(Type type)
|
|
| DotNetTypeToSqlType | Converts a .NET type into a SqlDbType.
public static SqlDbType DotNetTypeToSqlType(Type type)
|
|
| GenerateUniqueId | Generates a unique Id as a string of up to 16 characters. Based on a GUID and the size takes that subset of a the Guid's 16 bytes to create a string id. String Id contains numbers and lower case…
public static string GenerateUniqueId(int stringSize, string additionalCharacters)
|
|
| GenerateUniqueNumericId | Generates a unique numeric ID. Generated off a GUID and returned as a 64 bit long value
public static long GenerateUniqueNumericId()
|
|
| GetRandomNumber | Returns a random integer in a range of numbers a single seed value.
public static int GetRandomNumber(int min, int max)
|
|
| IndexOfByteArray | Returns an index into a byte array to find a string in the byte array. Exact match using the encoding provided or UTF-8 by default.
public static int IndexOfByteArray(byte[] buffer, byte[] bufferToFind)
|
|
| InitializeDataRowWithBlanks | Initializes a Datarow containing NULL values with 'empty' values instead. Empty values are: String - "" all number types - 0 or 0.00 DateTime - Value of MinimumSqlData (1/1/1900 by…
public static void InitializeDataRowWithBlanks(DataRow row)
|
|
| RemoveBytes | Removes a sequence of bytes from a byte array
public static byte[] RemoveBytes(byte[] buffer, byte[] bytesToRemove)
|
|
| SqlTypeToDotNetType | Maps a SqlDbType to a .NET type
public static Type SqlTypeToDotNetType(SqlDbType sqlType)
|
|
Assembly: Westwind.Utilities.dll
