¡@

Home 

c# Programming Glossary: dbnull

How can I easily convert DataReader to List<T>? [duplicate]

http://stackoverflow.com/questions/1464883/how-can-i-easily-convert-datareader-to-listt

typing and may reduce the number of errors when coding for DBNull etc. Once you cache the generated code they can be faster then..

Why is this code invalid in C#?

http://stackoverflow.com/questions/202271/why-is-this-code-invalid-in-c

code will not compile string foo bar Object o foo null DBNull.Value foo I get Error 1 Type of conditional expression cannot.. because there is no implicit conversion between 'System.DBNull' and 'string' To fix this I must do something like this string.. do something like this string foo bar Object o foo null DBNull.Value Object foo This cast seems pointless as this is certainly..

Nullable type as a generic parameter possible?

http://stackoverflow.com/questions/209160/nullable-type-as-a-generic-parameter-possible

object columnValue reader columnName if columnValue is DBNull return T columnValue return null But the error I get now is.. object columnValue reader columnName if columnValue is DBNull return T columnValue return null share improve this answer..

Handle DBNull in C#

http://stackoverflow.com/questions/2433155/handle-dbnull-in-c-sharp

DBNull in C# Is there a better cleaner way to do this int stockvalue.. cleaner way to do this int stockvalue 0 if Convert.IsDBNull reader StockValue stockvalue int reader StockValue c# datareader.. the result If reader StockValue is NOT of type int e.g. DBNull null will be returned and the operator will return the value..

What is the best way to deal with DBNull's

http://stackoverflow.com/questions/26809/what-is-the-best-way-to-deal-with-dbnulls

is the best way to deal with DBNull's I frequently have problems dealing with DataRows returned.. string value string row What is the best way to deal with DBNull's in this type of situation. c# .net sql server share improve.. type is nullable the as keyword returns null if a value is DBNull . It's ever so slightly faster than casting though only in certain..

C# (.NET) Design Flaws [closed]

http://stackoverflow.com/questions/411906/c-sharp-net-design-flaws

no non nullable string type and that you have to check for DBNull when fetching values from an IDataReader. c# .net design ..

How to assign null to a sqlparameter?

http://stackoverflow.com/questions/4555935/how-to-assign-null-to-a-sqlparameter

planIndexParameter.Value AgeItem.AgeIndex null DBNull.Value AgeItem.AgeIndex parameters 0 planIndexParameter c# dbnull.. type because you are either returning an int value or a DBNull type value which are not compatible. You can of course cast.. planIndexParameter.Value object AgeItem.AgeIndex DBNull.Value parameters 0 planIndexParameter Here is a quote from the..

Best way to check if a Data Table has a null value in it

http://stackoverflow.com/questions/4604414/best-way-to-check-if-a-data-table-has-a-null-value-in-it

question Try comparing the value of the column to the DBNull.Value value to filter and manage null values in whatever way.. row in table.Rows object value row ColumnName if value DBNull.Value do something else do something else More information about.. else do something else More information about the DBNull class If you just want to check if there is a null value in..

Convert DataTable to generic List?

http://stackoverflow.com/questions/545328/convert-datatable-to-generic-list

row dataField.FieldName .GetType .FullName.Equals System.DBNull properties i .SetValue obj row dataField.FieldName null .. pair in map object value row pair.Value1 if value is DBNull value null pair.Value2.SetValue item value null list.Add item..

How to achieve the C# 'as' keyword for value types in vb.net?

http://stackoverflow.com/questions/746767/how-to-achieve-the-c-sharp-as-keyword-for-value-types-in-vb-net

all database fields can be read with a DirectCast and any DBNull values are just ignored. The current code would be On Error.. with VS 2008 so we get the If oObject.Name If oReader.IsDBNull oReader.GetOrdinal Name String.Empty oReader.GetString oReader.GetOrdinal.. oReader.GetOrdinal Name oObject.Value If oReader.IsDBNull oReader.GetOrdinal Value 0 oReader.GetInt32 oReader.GetOrdinal..

C#: Pass a user-defined type to a Oracle stored procedure

http://stackoverflow.com/questions/980421/c-pass-a-user-defined-type-to-a-oracle-stored-procedure

if null oracleParameter.Value oracleParameter.Value DBNull.Value else oracleParameter new OracleParameter oracleParameter.Value.. new OracleParameter oracleParameter.Value parameter null DBNull.Value parameter adding udt mapping for the parameter if oracleParameter.Value.. SDO_SRID SdoSrid else OracleUdt.SetValue con pUdt SDO_SRID DBNull.Value if SdoPoint.IsNull OracleUdt.SetValue con pUdt SDO_POINT..