使用C#应用程序实现数据库连接 [英] Database Connectivity with C# Application

查看:126
本文介绍了使用C#应用程序实现数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在localhost上有一个数据库。我想用它连接一个C#应用程序。

我想把数据库文件本地放到那个应用程序中,每次都从那里拿起它。我不需要提供数据库路径。

应用程序:myapplication.exe

数据库:file.mdf和file_log.ldf。等等



请连接字符串解决方案。

谢谢

Suppose I have a database on localhost. I want to connect a C# application with it.
I want to just put database file local to that application and it pick it up from there each time. I don''t need to give database path.
Application: myapplication.exe
Database: file.mdf and file_log.ldf. etc

Please a connection string solution.
Thanks

推荐答案

否它不会工作。 .mdf和.ldf 是SQL Server文件,如果没有SQL Server引擎,您无法直接与这些文件交互。



另请查看 [ ^ ]
No It wont work. .mdf and .ldf are SQL Server files you cannot interact directly with these files without SQL Server Engine.

Also check this[^]


这篇关于使用C#应用程序实现数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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