开发者

Access Database C#

开发者 https://www.devze.com 2023-01-28 03:29 出处:网络
I want to h开发者_开发问答ave some tips. I have worked on SQL databases in c# but i am developing a new small level application that only has to store some contact numbers so i planed for access becau

I want to h开发者_开发问答ave some tips. I have worked on SQL databases in c# but i am developing a new small level application that only has to store some contact numbers so i planed for access because SQL will be overkill so i have never been to access database. How to Add access database file --> there is no file to add when I add new item to solution Consumption is same with a bit changes as that of SQL? like

"SELECT * FROM USERS WHERE uName=@username"


Why Don't you try using SQL lite or SQL CE? These use a file-base approach to store your data (ie they put a file in your app_data folder, as I think you want with access).

Some pointers

http://weblogs.asp.net/scottgu/archive/2010/06/30/new-embedded-database-support-with-asp-net.aspx

http://dotnetperls.com/sqlce

http://www.sqlite.org/


While I completely agree with Jaime on SQL Lite and SQL Compact Edition and back him up thoroughly, to answer your question, there will not be an Access Database to be added to the project from Visual Studio. However you can simply create an Access Database from Microsoft Access and manipulate it from C#. If you have previous experience in SQL Server, this would be very easy. Most of the objects and methods that you used from System.Data.SqlClient would be replaced by System.Data.OleDb. And yes you can use SQL syntax to interact with the database. As for the connection string to use, refer to Connection Strings for Access 2007


Use SQL Lite:

Is there a .NET/C# wrapper for SQLite?


You do not need to install anything to use Jet, the database used by Access. Jet has been installed with all versions of Windows for some time now. If you are using C# to work with the database, it will be very easy to install on other PCs, in that you can be fairly sure that nearly everyone will have Jet.

0

精彩评论

暂无评论...
验证码 换一张
取 消