如何在简单的Web项目中连接到.mdf(Microsoft SQL Server数据库文件)? [英] How do I connect to an .mdf (Microsoft SQL Server Database File) in a simple web project?

查看:283
本文介绍了如何在简单的Web项目中连接到.mdf(Microsoft SQL Server数据库文件)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具体来说,在VS 2008中,我想连接到一个数据源,您可以通过右键单击自动生成的App_Data文件夹(.mdf数据库)。似乎很容易,一旦你知道如何。

Specifically, in VS 2008, I want to connect to a data source that you can have by right-clicking on the automatically-generated App_Data folder (an .mdf "database"). Seems easy, and it is once you know how.

推荐答案

一个伟大的资源,我总是保持着 connectionstrings.com
当你找不到一个例子时,非常方便找到这些连接字符串。

A great resource I always keep around is connectionstrings.com. It's really handy for finding these connection strings when you can't find an example.

特别是此页面应用于您的问题

在连接到本地SQL Server时附加数据库文件Express实例

Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;

这篇关于如何在简单的Web项目中连接到.mdf(Microsoft SQL Server数据库文件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆