Jump to content

C# DB, please help me!

- - - - -

  • Please log in to reply
1 reply to this topic

#1
xle_camry

xle_camry

    Programmer

  • Members
  • PipPipPipPip
  • 141 posts
Hello, dear friends!

I am a beginner in C# and I want your help, your advices.
My friend gave me a task to do:

I have to create 2 textboxes and 1 button.
When pressing the button, those data must go to database.

Questions are these:

1. How should I create database and table?
2. How to store that data into database? (Connection, etc)

I want a sample code. Anyone could help me? Will be grateful.
Thanks in advance.

PS: I use M.Visual Studio 2008 and SQL Server 2008. But I am a beginner, I should start from zero.

#2
lespauled

lespauled

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 231 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash
Inside of VS, you can create a new database. Another option is to use SQL Server Management Studio (free from MS downloads) to create, populate and create the SQL statements for your app.

Inside that database, you can create new tables. Give the table definitions for each table and populate them by wither selecting edit data, or creating INSERT statements in a query window.

You have 2 options for database connectivity in your app. 1 is the fully automatic method, which is very easy, but never used in the professional world. 2 is hand coding a database access class that handles all data operations.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users