zoukankan      html  css  js  c++  java
  • VS2010中连接sdf数据库的字符串 Kevin

    源于《Pro ASP.NET MVC 3 Framework>>中的一个列子项目

    需要用到EntityFramework连接数据库

    由于VS2010 中自带了SQLserver 2008 Express版,在VS中新建了一个SportStore的数据库,文件路径是I:\程序员的修炼之道\BrooklynWorkShop\personal\SportStore.sdf

    在webconfig中的添加连接字符串如下:

    <connectionStrings>
    <add name="EFDbContext" connectionString="Data Source=I:\程序员的修炼之道\BrooklynWorkShop\personal\SportStore.sdf;Password=1;Persist Security Info=False;" providerName="System.Data.SqlServerCe.4.0"/>
    </connectionStrings>

    其中provideName写System.Data.SqlServerCe.4.0 

    之前写的System.Data.Client 和 System.Data.SqlServerCe 都会报错。

    在网上查了一下,sdf是微软用于嵌入式的一种简单的数据库。

  • 相关阅读:
    20201031
    20201028
    20201026
    20201027
    20201020
    ReentrantReadWriteLock原理分析
    java中Thread源码介绍
    CountDownLatch原理分析
    Semaphore原理分析
    AQS-共享模式分析
  • 原文地址:https://www.cnblogs.com/kfx2007/p/2555767.html
Copyright © 2011-2022 走看看