问题描述
很简单的问题。我建立一个应用程序从一个SQL Server 2005实例中读取数据。我想跑我的笔记本电脑的一些测试(不具有SQL 2005),所以我一直在寻找在本地数据库为测试的目的交换。
Pretty straightforward question. I'm building an app which reads data from a SQL Server 2005 instance. I wanted to run some tests on my laptop (which does not have SQL 2005) so I was looking at swapping in a local database for the purpose of the tests.
我M使用VS2008所以精简版DB似乎是一个自然的选择。我曾希望刚换出我的连接字符串,但它似乎只会让我连接到使用的SqlCeConnection,而不是的SqlConnection的CE数据库。解决这个办法,修饰我也许可以在连接字符串中使用?
I'm using VS2008 so the Compact Edition DB seemed a natural choice. I had hoped to just swap out my connection string, but it seems It will only let me connect to the CE database using the SqlCeConnection and not SqlConnection. Any way around this, modifiers I can use in the connection string perhaps?
推荐答案
它实际上是非常可能的用户SQL CE,而不是全面爆发的SQL Server只修改配置参数:改变连接字符串,并使用 IDbXXX
系列接口尽可能代替特定于平台的 SqlXXX
和 SqlCeXXX
的。请参见。
It's actually very possible to user SQL CE instead of full-blown SQL Server by only modifying configuration parameters: change connection string and use IDbXXX
family interfaces wherever possible instead of platform-specific SqlXXX
and SqlCeXXX
ones. See DbProviderFactories.
被告知,但是,在这两个平台上的SQL方言的差异。
Be advised, however, of differences in SQL dialects of these two platforms.
这篇关于连接到SQL CE数据库使用的SQLConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!