¡@

Home 

c# Programming Glossary: idatarecord

Why can't I unbox an int as a decimal?

http://stackoverflow.com/questions/1085097/why-cant-i-unbox-an-int-as-a-decimal

can't I unbox an int as a decimal I have an IDataRecord reader that I'm retrieving a decimal from as follows decimal..

Writing driver class generic for any database support

http://stackoverflow.com/questions/13133804/writing-driver-class-generic-for-any-database-support

T Get T string query Action IDbCommand parameterizer Func IDataRecord T selector int Add string query Action IDbCommand parameterizer.. Get S string query Action IDbCommand parameterizer Func IDataRecord S selector return Do query parameterizer ExecuteReader selector.. parameterizer ExecuteReader selector static IEnumerable IDataRecord ExecuteReader IDbCommand cmd using var r cmd.ExecuteReader..

Get an IDataReader from a typed List

http://stackoverflow.com/questions/2258310/get-an-idatareader-from-a-typed-list

was outside the range of 0 through see cref P System.Data.IDataRecord.FieldCount . exception filterpriority 2 filterpriority public.. abstract bool Read #endregion #region Implementation of IDataRecord public int FieldCount get return Fields.Count public virtual.. i throw new IndexOutOfRangeException name object IDataRecord.this int i get return GetValue i public virtual bool GetBoolean..

Fastest method for SQL Server inserts, updates, selects

http://stackoverflow.com/questions/2862428/fastest-method-for-sql-server-inserts-updates-selects

that looks something like this private static IEnumerable IDataRecord Retrieve string sql Action SqlParameterCollection addParameters.. be written even shorter using .Net 3.5 public IEnumerable IDataRecord GetFooChildrenByParentID int ParentID I could easily use a stored.. and methods go here public static Foo FooFactory IDataRecord record return new Foo Property1 record 0 Property2 record..

Can a Generic Method handle both Reference and Nullable Value types?

http://stackoverflow.com/questions/303287/can-a-generic-method-handle-both-reference-and-nullable-value-types

series of Extension methods to help with null checking on IDataRecord objects which I'm currently implementing like this public static.. like this public static int GetNullableInt32 this IDataRecord dr int ordinal int nullInt null return dr.IsDBNull ordinal nullInt.. ordinal public static int GetNullableInt32 this IDataRecord dr string fieldname int ordinal dr.GetOrdinal fieldname return..

Check for column name in a SqlDataReader object

http://stackoverflow.com/questions/373230/check-for-column-name-in-a-sqldatareader-object

DataRecordExtensions public static bool HasColumn this IDataRecord dr string columnName for int i 0 i dr.FieldCount i if dr.GetName..

Return DataReader from DataLayer in Using statement

http://stackoverflow.com/questions/850065/return-datareader-from-datalayer-in-using-statement

it row by row. That lead me to this public IEnumerable IDataRecord GetSomeData string filter string sql SELECT FROM SomeTable WHERE.. rdr cmd.ExecuteReader while rdr.Read yield return IDataRecord rdr This will work even better once we move to 3.5 and can.. make it a generic IEnumerable T return type and add a Func IDataRecord T parameter to convert the DataReader state to business objects..

Repository and Data Mapper pattern

http://stackoverflow.com/questions/8844105/repository-and-data-mapper-pattern

DataMapper Personnel public override Personnel Map IDataRecord record return new Personnel FirstName record FirstName .ToString..