连接到SQL Server和Windows窗体应用程序 [英] Connecting to SQL Server and a Windows Form Application

查看:162
本文介绍了连接到SQL Server和Windows窗体应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我遇到了问题我需要一些帮助。我正在创建一个应用程序,我需要连接到数据库(MSSQL或Access或MySQL)。请建议我创建一个前端,用户(客户端)可以从这里设置这样的信息,如:哪个服务器?,用户名?,密码?和连接引擎?

另外,如果我没有错,那么Access,MSSQL和MySql的SQL查询之间存在差异,所以我需要创建多个类来管理它们。请指导我一点。

非常感谢。



Tushar Srivastava

解决方案

它非常很简单,你将不得不使用实体框架,它自动根据数据库服务器转换sql查询。你将不得不支付
1:复制DAL类并将它们粘贴到DAL中,只需进行一些矿工更改,例如

(i)编写以SqlConnection为主的OracleConnection和OleDbConnection。 br />
它是一个完整的教程,可以解决你的问题



http://www.youtube.com/watch?v=aoFDyt8oG0k



http://www.youtube.com/playlist?list=PL6n9fhu94yhX5dzHunAI2t4kE0kOuv4D7

http://csharp-video-tutorials.blogspot.com/十分之二千零一十二/什么-是-ADONET部分-1.HTML

Hi Friends,

I am stuck in a problem and I need a little help. I am creating an application wherein I need to connect to a Database (MSSQL or Access or MySQL). Kindly suggest me to create a front end from where a user (client) can setup this information like: which server?, username?, password? and connection engine? etc.
Also, if I am not wrong, there is a difference between the SQL queries for Access, MSSQL and MySql so I need to create multiple classes to manage those also. Kindly guide me a little.
Thank you very much.

Tushar Srivastava

解决方案

Its very easy, you will have to use entity framework, which translates sql queries according to the database server automatically. You will have to
1: Copy DAL classes and paste them in DAL, just do some miner changes like
(i) write OracleConnection insteated of SqlConnection, and OleDbConnection.
its a Complete Tutorial which can solve your problem

http://www.youtube.com/watch?v=aoFDyt8oG0k

http://www.youtube.com/playlist?list=PL6n9fhu94yhX5dzHunAI2t4kE0kOuv4D7
http://csharp-video-tutorials.blogspot.com/2012/10/what-is-adonet-part-1.html


这篇关于连接到SQL Server和Windows窗体应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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