I'm doing alot of stuff with databases.
Currently I have to wrap half my query code with something that looks like this:
MyString = Iif( IsDbNull( GetValueFromDatabase(myField) ), "", GetValu...
http://www.experts-exchange.com/Programming/Languages/.NET/Q_20766601.html
Zones:
.NETDate Answered: 10/14/2003 Rating: 6.4 Views: 0
hi, i need to somehow determine if a Oledbcommands execute scalar method returns 0.
the problem is as soon as it does, i get a "cast type from Dbnull to integer" error.
thus i devised this plan...
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_21052029.htm...
Good evening!
I am getting error:System.InvalidCastException: Cast from type 'DBNull' to type 'String' is not valid, when database value is dbnull.
When I call a function:
Protected Function rv...
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_21185317.htm...
I am confused. I have tried a number of things and I can get this to work. The only thing that has worked is hard coding a DBNull.Value at the end of this sql parameter statement. In this instan...
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_21305548.html
If the database does have a null for this field it gives: Cast from type 'DBNull' to type 'Boolean' is not valid. If the field isn't null it works ok. Why is it flagging that boolean when it shou...
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_21427221.html
In my newbie-ness, I assumed
wrkArr3(n) = ""
wrkColumn.DefaultValue = wrkArr3(n)
would replace a DBNull from MS-SQL with a "" (blank string?) during wrkAdapter.Fill of myTable
but t...
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_21769948.htm...
I am working on optimizing an application which utilizes an access database. Just before the application finished processing I received and error message, Problem OccurredCast from type DBNull to...
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_21794685.htm...
Hi I need to check if a date stored in my db is null and if so then display some text.
DateTime StoppedDate = Convert.ToDateTime((DateTime)row["StoppedDate"].ToString());
if(StoppedDate == DB...
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_21893755.html
Zones:
C#Date Answered: 06/21/2006 Rating: 8.6 Views: 0
This works. The try/catch seems to be needed for cases of DBNull.
I'm looking for a more efficient way to handle the DBNull case.
Public Function TimeOnly(ByVal varTime As Object) As Strin...
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22010214.html
In a VB.net application using a SQLCE database we are using a SqlCeDataReader to "read" values from the DB. The values are then sent to a webservice.
The problem occurs when we use an IF to chec...
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Studio_.NET_2005/Q_22771...
Zones:
Visual StudioDate Answered: 08/18/2007 Rating: 7.6 Views: 4