Cannot find namespace 'System.Data.SqlServerCe'

后端 未结 5 2149
广开言路
广开言路 2020-12-01 15:46

I did include the System.Data.SqlServerCe dll, put using System.Data.SqlServerCe; in my code, but when I open the .NET page I get:

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 16:39

    If you have an existing reference to System.Data.SqlServerCe yet you see a yellow symbol next to it then you should:

    • Remove the reference by right-clicking it.
    • Re-Add the reference.

    To Re-Add: Right click the References folder and select Add Reference... option. Go to the Assemblies | Framework option on the left pane, then scroll to System.Data.SqlServerCe in the right pane. If it's there, click it then be sure to check the checkbox next to it before clicking OK.

    If System.Data.SqlServerCe is not in the list then you're going to have to browse for it on your computer. To do that, click the Add Reference... dialog's Browse... button and try looking in this folder:

    C:\Program Files\Microsoft SQL server Compact edition\v3.5\Desktop
    

    or

    C:\Program Files\Microsoft SQL server Compact edition\v4.0\Desktop
    

    (The v#.# value in the examples above might be different by the time you read this, so navigate first to C:\Program Files\Microsoft SQL server Compact edition\ then choose the latest version or a specific version if you know what that should be.)

    Once you find it by browsing, select the System.Data.SqlServerCe.dll file and OK your way out then try recompiling.

提交回复
热议问题