Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 IsDBNull Ambigous name?

Author  Topic 

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-03-03 : 09:32:43
I need a little help here. I'm using IsDBNull and I reference the class: Imports Microsoft.VisualBasic.Information. The problem is that I also need to use the class for DataReader and it keeps giving me this error.

"IsDBNull" is ambiguous, imported form the namespaces or types 'Microsoft.VisualBasic.Information, SqlClient.SqlDataReader'.

If I remove the data reader class, then it doesn't work. If I remove the IsDBNull class then it doesn't work.

Any Suggestions?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-03 : 11:07:54
use
DataRow dr ...
if (dr["ColumnName"] == DBNull.Value)
{}

Go with the flow & have fun! Else fight the flow
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-03-03 : 14:49:14
Remove all references to Microsoft.VisualBasic
muhahaha

And don't use NULLS in the database
mwhwhhhahaaha

Not very constructive post, but I couldn't resist

rockmoose
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-03-03 : 15:27:18
Thanks for the help, but I got it to work now. Removed the Imports System.Data.SqlClient.SqlDataReader. I still have to use the Microsoft.VisualBasic.Information, because my IsDBNull needs to reference that object.

What was causing the problem was when I pass the variable from the first page to the next. It didn't get pass and when it was looking for that variable it wouldn't work with my data reader. Now all is good that I got it to pass the variables.
Go to Top of Page
   

- Advertisement -