Click here to Skip to main content
15,881,702 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello, i am trying to create application using database, can you please explain me easiest way to create a simple database with 2 tables and 1 relation between them and how to connect to that database using C# and do some basic query like
C#
"SELECT x FROM table WHERE ID==10"


Thank you
Posted
Updated 8-Jan-12 4:37am
v3

if you want to create database using C#,see this
Create a SQL Server Database
use ADO.net for database connectivity
ADO.Net

otherwise sql server mgmt. studio is easiest way to create database and tables.
see this http://www.sqlserver2005tutorial.com/
 
Share this answer
 
Comments
Mehdi Gholam 8-Jan-12 1:31am    
5'ed
uspatel 8-Jan-12 6:42am    
thanks......
Uday P.Singh 8-Jan-12 4:25am    
5ed :)
uspatel 8-Jan-12 6:42am    
thanks.....
Sergey Alexandrovich Kryukov 8-Jan-12 12:56pm    
Right, a 5.
--SA
I would recommend this simple, clear, short an informative CodeProject article for beginners: Using ADO.NET for beginners[^].

—SA
 
Share this answer
 
Comments
Mehdi Gholam 8-Jan-12 1:31am    
5'ed
Sergey Alexandrovich Kryukov 8-Jan-12 12:55pm    
Thank you, Mehdi. All credit goes to the author of the article though.
--SA
Uday P.Singh 8-Jan-12 4:26am    
5ed :)
Sergey Alexandrovich Kryukov 8-Jan-12 12:55pm    
Thank you, Uday. All credit goes to the author of the article though.
--SA
Monjurul Habib 8-Jan-12 6:17am    
5!
Hi,
For beginners Ado.net in C#. Follow the bellow links :

Beginners guide to accessing SQL Server through C#

Using ADO.NET for beginners
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900