The type or namespace name 'DataSetExtensions' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

前端 未结 1 380
攒了一身酷
攒了一身酷 2020-12-20 18:57

I know this is a common error but I have the correct reference to the System.Data.DataSetExtensions.dll added to the project and my project is a SQL CLR project built for .n

相关标签:
1条回答
  • 2020-12-20 19:24

    System.Data.DataSetExtensions is an assembly, not a namespace. You just need to add a reference to System.Data.DataSetExtensions.dll (as you say you already have) and then a using directive for the System.Data namespace:

    using System.Data;
    

    That will pull in all the extension methods in the classes in that namespace, e.g. DataRowExtensions.

    When you're looking in documentation, always be careful about the difference between namespaces and assembly names - they're often the same, but they're logically independent.

    0 讨论(0)
提交回复
热议问题