Dataset ambiguous error

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I am getting an error from defining my Dataset.

The error is:

BC30561: 'DataSet' is ambiguous, imported from the namespaces or types
'System.Data, DreamweaverCtrls'.

I am using Dreamweaver, but am doing all the database functions by hand.

My function is:

Sub CheckStoredLetters()
Dim myDbObject as new DbObject()
Dim parameters As SqlParameter () = { _
New SqlParameter("@Email",SqlDbType.VarChar,45) }

parameters(0).value = session("Email")

Dim dbDataSet as DataSet = myDbObject.RunProcedure("GetCoverLetters",
parameters,"CoverLetters")

DataList1.DataSource=dbDataSet
DataList1.Member="Letters"
DataList1.databind()

End Sub


The error is on this line:

Dim dbDataSet as DataSet = myDbObject.RunProcedure("GetCoverLetters",
parameters,"CoverLetters")

I also got the error if I tried:

Dim dbDataSet as DataSet

What would cause this error?

Thanks,

Tom
 
You have two classes with same name available in the naming scope (by
available namespaces). You need to provide the class name explicitly (with
namespace) to overcome that.

Dim dbdataset As System.Data.DataSet =
myDbObject.RunProcedure("GetCoverLetters", parameters,"CoverLetters")

assuming that it System.Data.DataSet is the returned one.
 
That was it.

Thanks,

Tom
Teemu Keiski said:
You have two classes with same name available in the naming scope (by
available namespaces). You need to provide the class name explicitly (with
namespace) to overcome that.

Dim dbdataset As System.Data.DataSet =
myDbObject.RunProcedure("GetCoverLetters", parameters,"CoverLetters")

assuming that it System.Data.DataSet is the returned one.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
 
Back
Top