By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,458 Members | 1,299 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,458 IT Pros & Developers. It's quick & easy.

New C# programmer questions

P: n/a
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!
Jul 7 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"CSharp-Jay" wrote:
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/Tutori.../Lesson01.aspx

Whereas this article demonstrates using OleDb to read Access databases.

http://www.codeproject.com/KB/databa...sInCSharp.aspx

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

--
Happy Coding!
Morten Wennevik [C# MVP]

Jul 7 '08 #2

P: n/a
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]
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!

Jul 7 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.