-
Notifications
You must be signed in to change notification settings - Fork 2
BizArk.Core.Extensions.DataExt
Brian Brewder edited this page Apr 1, 2017
·
1 revision
Back to BizArk.Core API Reference
Provides extension methods for string arrays.
-
public static bool? GetBool(this DataRow row, string fieldName)- Returns the field value as a bool. Uses ConvertEx to convert the value. -
public static byte[] GetBytes(this DataRow row, string fieldName)- Returns the field value as a byte array. -
public static DateTime? GetDateTime(this DataRow row, string fieldName)- Returns the field value as a DateTime. Uses ConvertEx to convert the value. -
public static double? GetDouble(this DataRow row, string fieldName)- Returns the field value as a double. Uses ConvertEx to convert the value. -
public static Guid? GetGuid(this DataRow row, string fieldName)- Returns the field value as a Guid. Uses ConvertEx to convert the value. -
public static int? GetInt(this DataRow row, string fieldName)- Returns the field value as a int. Uses ConvertEx to convert the value. -
public static string GetString(this DataRow row, string fieldName)- Returns the field value as a string. Uses ConvertEx to convert the value. -
public static T GetValue<T>(this DataRow row, string fieldName)- Returns the field value as the specified type. Uses ConvertEx to convert the value to the correct type.
-
public static bool? GetBool(this DataRowView row, string fieldName)- Returns the field value as a int. Uses ConvertEx to convert the value. -
public static byte[] GetBytes(this DataRowView row, string fieldName)- Returns the field value as a byte array. -
public static DateTime? GetDateTime(this DataRowView row, string fieldName)- Returns the field value as a int. Uses ConvertEx to convert the value. -
public static double? GetDouble(this DataRowView row, string fieldName)- Returns the field value as a double. Uses ConvertEx to convert the value. -
public static Guid? GetGuid(this DataRowView row, string fieldName)- Returns the field value as a Guid. Uses ConvertEx to convert the value. -
public static int? GetInt(this DataRowView row, string fieldName)- Returns the field value as a int. Uses ConvertEx to convert the value. -
public static string GetString(this DataRowView row, string fieldName)- Returns the field value as a string. Uses ConvertEx to convert the value to a string. -
public static T GetValue<T>(this DataRowView row, string fieldName)- Returns the field value as the specified type. Uses ConvertEx to convert the value to the correct type. -
public static bool IsNull(this DataRowView row, string fieldName)- Determines if the field is null.
-
public static bool ContainsField(this IDataReader row, string fieldName)- Determines if the IDataReader contains the specified field. -
public static bool? GetBool(this IDataReader row, string fieldName)- Returns the field value as a int. Uses ConvertEx to convert the value. -
public static byte[] GetBytes(this IDataReader row, string fieldName)- Returns the field value as a byte array. -
public static DateTime? GetDateTime(this IDataReader row, string fieldName)- Returns the field value as a int. Uses ConvertEx to convert the value. -
public static double? GetDouble(this IDataReader row, string fieldName)- Returns the field value as a double. Uses ConvertEx to convert the value to a double. -
public static decimal? GetDecimal(this IDataReader row, string fieldName)- Returns the field value as a decimal. Uses ConvertEx to convert the value to a decimal. -
public static Guid? GetGuid(this IDataReader row, string fieldName)- Returns the field value as a Guid. Uses ConvertEx to convert the value. -
public static int? GetInt(this IDataReader row, string fieldName)- Returns the field value as a int. Uses ConvertEx to convert the value. -
public static string GetString(this IDataReader row, string fieldName)- Returns the field value as a string. Uses ConvertEx to convert the value to a string. -
public static T GetValue<T>(this IDataReader row, string fieldName, T dfltVal)- Returns the field value as the specified type. Uses ConvertEx to convert the value to the correct type. -
public static bool IsNull(this IDataReader row, string fieldName)- Determines if the field is null.
-
public static IEnumerable<SqlParameter> AddParameters<T>(this SqlCommand cmd, string paramNameRoot, IEnumerable<T> values, int start = 1, string separator = ", ")- This will add an array of parameters to a SqlCommand. This is used for an IN statement. Use the returned value for the IN part of your SQL call. (i.e. SELECT * FROM table WHERE field IN ({paramNameRoot})) -
public static IEnumerable<SqlParameter> AddParameters<T>(this SqlCommand cmd, string paramNameRoot, params T[] values)- Adds a value to the end of the parameter collection. -
public static IEnumerable<SqlParameter> AddParameters(this SqlCommand cmd, object parameters)- Adds the objects properties as parameters. -
public static string DebugText(this SqlCommand cmd)- Converts the command into TSql that can be executed in Sql Server Management Studio.
-
public static SqlParameter AddWithValue(this SqlParameterCollection parameters, string name, object value, bool setNull)- Adds a value to the end of the parameter collection.