简体   繁体   中英

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.

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;

SqlXml is a type, not a namespace.

use this instead: using System.Data.SqlTypes;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM