1

出于某种原因,我无法为特定数据库创建类型提供程序。我的代码看起来有点像这样(显然不是实际的数据库名称):

type db1 = SqlDataConnection<"Data Source=SQL_05;Initial Catalog=**DATABASE1**;Integrated Security=true;MultipleActiveResultSets=True">
type db2 = SqlDataConnection<"Data Source=SQL_08;Initial Catalog=**DATABASE2**;Integrated Security=true;MultipleActiveResultSets=True">
type db3 = SqlDataConnection<"Data Source=SQL_10;Initial Catalog=**DATABASE3**;Integrated Security=true;MultipleActiveResultSets=True">

前两行完全没问题,只要这些是我需要的唯一数据库,我的程序就可以正常工作。然而,一旦我添加了第三行,我就得到了一个巨大的错误:

The type provider 'Microsoft.FSharp.Data.TypeProviders.DesignTime.DataProviders' reported an error:  
tmp7AA1.cs(12,7): warning CS0437: The type 'System' in '...\AppData\Local\Temp\tmp7AA1.cs' conflicts with the imported namespace 'System' in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll'. Using the type defined in '...\AppData\Local\Temp\tmp7AA1.cs'.
tmp7AA1.cs(88967,22): (Location of symbol related to previous warning)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll: (Location of symbol related to previous warning)
tmp7AA1.cs(12,7): error CS0138: A using namespace directive can only be applied to namespaces; 'System' is a type not a namespace
tmp7AA1.cs(88967,22): (Location of symbol related to previous error)tmp7AA1.cs(13,7): 
warning CS0437: The type 'System' in '...\AppData\Local\Temp\tmp7AA1.cs' conflicts with the imported namespace 'System' in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll'. Using the type defined in '...\AppData\Local\Temp\tmp7AA1.cs'.
tmp7AA1.cs(88967,22): (Location of symbol related to previous warning)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll: (Location of symbol related to previous warning)
tmp7AA1.cs(88967,31): error CS0246: The type or namespace name 'INotifyPropertyChanging' could not be found (are you missing a using directive or an assembly reference?)
tmp7AA1.cs(88967,56): error CS0246: The type or namespace name 'INotifyPropertyChanged' could not be found (are you missing a using directive or an assembly reference?)
tmp7AA1.cs(13,14): error CS0426: The type name 'Collections' does not exist in the type 'System'
tmp7AA1.cs(14,7): warning CS0437: The type 'System' in '...\AppData\Local\Temp\tmp7AA1.cs' conflicts with the imported namespace 'System' in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll'. Using the type defined in '...\AppData\Local\Temp\tmp7AA1.cs'.
tmp7AA1.cs(88967,22): (Location of symbol related to previous warning)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll: (Location of symbol related to previous warning)
tmp7AA1.cs(14,14): error CS0426: The type name 'ComponentModel' does not exist in the type 'System'

以此类推,为116460 行!

我可以连接到 SSMS 中的每个服务器,以验证这些连接字符串是否有效。这是我看到的:

  • SQL_05是版本 10.0.2531 (SQL Server 2008)
  • SQL_08是版本 10.0.2500 (SQL Server 2008)
  • SQL_10是版本 10.50.4286 (SQL Server 2008 R2)

除此之外,我看不出三台服务器之间有任何区别。我在这里缺少什么吗?我是否需要添加一些引用才能为该特定服务器创建类型提供程序?

4

0 回答 0