how to start using db in .NET platform
i want the most simple example from scratch how to
- 开发者_如何学Python
open new db
populate it with one table
connect and open it to simple select query
I have been looking for sothing relvant in the last 2 days please help me i neede just the basic
I am using visual studio 2008/2010 and i know mysql but dont know how to use VS for DB
I would prefer example using ADO.NET
There are tons of ways to do that.
Have a look at ADO.NET, LINQ2SQL, Entity Framework, NHibernate ....
You can find a lot of examples in internet.
If you want to stick with MySQL and C#, this PDF will walk you through the process.
http://dev.mysql.com/tech-resources/articles/Beginning_MYSQL_5_with_Visual_Studio.NET_2005.pdf
If you're just getting a start on things, check out the ASP.Net tutorial on building a Data Access Layer using TableAdapters. This is a great start because it gives you a nice drag and drop type interface for a lot of things, in addition to giving you strongly typed data. All the concepts of data adapters and connection strings are there, just managed by the object it creates.
The nice thing about the Table Adapters is that it leverages ADO.Net so you simply have to replace your DataAdapter with SQL, MySQL, SQLite adapter you need.
Once you get the hang of that, you can move into integrating your Business layer as well through the LINQ to SQL tutorials.
I've been in the same situation, just finding my feet with ADO and .Net database handling in Visual Studio. Up to now I'm finding that some of the most useful guides are:
- Walkthrough of getting started with SQL Server Compact
- Tutorial on Linq-to-SQL
- The guide to using table adapters to synchronise the DataSet with the database
hi there my personal preference would be to use pgsql server and npgsql.dll. the link to pgsql is here and just google npgsql.
these are the best documented fastest and easiest to use databases i have found (that is an opinion open to suggestions)
精彩评论