New C# programmer questions

C

CSharp-Jay

So I have been working pretty hard on the C# coding, and I am doing
pretty well so far at it. I started out with simple console apps and
eventually made a little windows application that took your salary &
hours per week and could calculate your monthly, weekly & hourly pay
with or without taxes taken out. Pretty nifty, but at this point I
want to get into pulling data out of databases for my next test
project. I have tried surfing all over the net and I can't seem to
find any updated documentation that makes sense to me as a new
programmer, of how to add and access/change data from a database.
Some xtra information for those willing to help is below, thanks
again :)

Developing in: Visual Studio 2008
Database: Microsoft Access Database
Database Location: C:\customer.mdb
Password Protected DB = No
Table Name: Info
Table Primary Key: CID
Table Field1: FirstName
Fields on Program: txtCustomerName

I wanna be able to connected, pull up customer by the name typed in,
and later be able to change that information. I hope this helps let
me know if you need any more information, thanks!
 
M

Morten Wennevik [C# MVP]

CSharp-Jay said:
So I have been working pretty hard on the C# coding, and I am doing
pretty well so far at it. I started out with simple console apps and
eventually made a little windows application that took your salary &
hours per week and could calculate your monthly, weekly & hourly pay
with or without taxes taken out. Pretty nifty, but at this point I
want to get into pulling data out of databases for my next test
project. I have tried surfing all over the net and I can't seem to
find any updated documentation that makes sense to me as a new
programmer, of how to add and access/change data from a database.
Some xtra information for those willing to help is below, thanks
again :)

Developing in: Visual Studio 2008
Database: Microsoft Access Database
Database Location: C:\customer.mdb
Password Protected DB = No
Table Name: Info
Table Primary Key: CID
Table Field1: FirstName
Fields on Program: txtCustomerName

I wanna be able to connected, pull up customer by the name typed in,
and later be able to change that information. I hope this helps let
me know if you need any more information, thanks!

Hi Jay,

What you need is to use an OldDbCommand, either directly or wrapped in an
OleDbDataAdapter. To be able to use OleDbCommand it needs an OleDbConnection
and a command string, and the OleDbConnection needs a connection string
(www.connectionstrings.com may help you create this).

This tutorial may get you started with the basic understanding of ADO.Net

http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson01.aspx

Whereas this article demonstrates using OleDb to read Access databases.

http://www.codeproject.com/KB/database/linkAccessInCSharp.aspx

If you find little information on OleDb classes try googling SqlCommand etc
as the usage is identical in most cases.
 
A

Andrei Varanovich [C# MVP]

Hello,

I would also recommend you to have a look at the ORM concept as well as LINQ
2 SQL and ADO .NET Entity Framework.

Kind regards,
Andrei Varanovich [C# MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top