如何在Visual Studio中访问数据库 [英] How to acesss a database in Visual studio
本文介绍了如何在Visual Studio中访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在一个包含sql数据库的项目中,但是我无法在c#中创建sql数据库,我知道通过右键单击解决方案资源管理器来添加sql数据库,但是我不知道如何
I''m on a project that includes sql database but i can''t create a sql database in c# I know to add a sql database by right clicking on the solution explore, but I don''t know how to update, delete, and add data by a button.
推荐答案
对于数据库连接,您将需要一个连接字符串.
为此,您可以在此处 [ ^ ].这篇解释了如何做到这一点. "通过C#访问SQL Server的入门指南 [
对于创建,更新,删除操作,我们基本上将其称为"CRUD操作",您必须检查这些网页;
为初学者使用ADO.NET [ http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson01.aspx [ ^ ]
对于更高级的级别,请使用LINQ;
http://www.dotnetspark.com/kb/667-crud-operations- using-linq-entities.aspx [ ^ ]
For the database connection you will be needing a connection string.
For this you can find the appropriate connection string here[^]. This one explains how it can be done. " Beginners guide to accessing SQL Server through C#[^] "
For the create, update, delete oerations we basically call the "CRUD Operations" you have to check these web pages;
Using ADO.NET for beginners[^]
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson01.aspx[^]
For more advanced level use LINQ;
http://www.dotnetspark.com/kb/667-crud-operations-using-linq-entities.aspx[^]
您应该尝试使用google.这是第一个链接,可能很有用. http://msdn.microsoft.com/en-us/library/ms186197%28v = vs.80%29.aspx [ ^ ]
You should try google. This is the first link and is probably useful. http://msdn.microsoft.com/en-us/library/ms186197%28v=vs.80%29.aspx[^]
这篇关于如何在Visual Studio中访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文