sir_thursday
sir_thursday

Reputation: 5409

System.Data.SqlTypes.SqlXml is a type not a namespace

I'm including this line: using System.Data.SqlTypes.SqlXml; in order to make the below code work.

SqlXml sqlXml = reader["ScenarioData"].GetSqlXml();

The GetSqlXml(); error is solved by including the above using line, but then I get the error that "System.Data.SqlTypes.SqlXml is a type not a namespace"

Am I missing a dll reference or something? I can't find it.

Upvotes: 1

Views: 713

Answers (2)

Cam Bruce
Cam Bruce

Reputation: 5689

SqlXml is a type, not a namespace.

use this instead: using System.Data.SqlTypes;

Upvotes: 0

It'sNotALie.
It'sNotALie.

Reputation: 22794

This is not like Java, you don't import separate classes. You import whole namespaces. Try this instead:

using System.Data.SqlTypes;

Alternatively, if you really want to follow Java rules, use this code instead:

using SqlXml = System.Data.SqlTypes.SqlXml;

Upvotes: 4

Related Questions