Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我包括这一行: using System.Data.SqlTypes.SqlXml;为了使下面的代码工作。
using System.Data.SqlTypes.SqlXml;
SqlXml sqlXml = reader["ScenarioData"].GetSqlXml();
通过包含上面的 using 行解决了该GetSqlXml();错误,但随后我收到“System.Data.SqlTypes.SqlXml是类型而不是名称空间”的错误
GetSqlXml();
System.Data.SqlTypes.SqlXml
我是否缺少 dll 引用或其他内容?我找不到它。
这不像 Java,你不导入单独的类。您导入整个命名空间。试试这个:
using System.Data.SqlTypes;
或者,如果您真的想遵循 Java 规则,请改用以下代码:
using SqlXml = System.Data.SqlTypes.SqlXml;
SqlXml是一种类型,而不是命名空间。
SqlXml
改用这个:using System.Data.SqlTypes;