We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,716 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Using Database with VB.NET

Hi, I'm currently studying this language how do i connect VB.NET with a Database (MS Access) and let me input informations in it as well as retrieve informations from it?

I'm not familiar with MS Access but i know how to enter the name and it's type so that i can input informations in them (Name: Numbers Type: Integer something like that.) and also what's a Primary Key?

4
Contributors
6
Replies
3 Days
Discussion Span
3 Months Ago
Last Updated
10
Views
RaoxFaello
Newbie Poster
9 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

First you will have to learn fundamentals of SQL (Structured Query Language), which is the language used by Access and other databases such as MySQL, Oracle, Sybase and MS SQL (there are lots of others too). If you already know that then go on to reading a tutorial. Here is a link that has other links to Microsoft tutorials

Ancient Dragon
Achieved Level 70
Team Colleague
32,116 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68

The most common connections are

  1. ADO
  2. SqlClient
  3. OLEDB

ADO is the underlying connection behind both SqlClient and OLEDB but provides only basic functionality. SqlClient is used for connecting only to SQL databases but has the advantage of supporting named parameters (don't worry about that for now). OLEDB is the most generic (it can be used to connect to SQL, Access, Excel, CSV, etc) and also supports parameters (but not named ones). To connect to a data source you specify the connection information via a connection string which varies depending on the data source type and location. The web site I just linked to details many many sample connection strings.

Reverend Jim
Carpe per diem
Moderator
3,592 posts since Aug 2010
Reputation Points: 561
Solved Threads: 445
Skill Endorsements: 32

You are on the right track by acknowledging that you need to learn how to do this versus the all to common "I want code that does this and I have no intention of ever understanding it".

This site is an excellent starting point.

Visual Basic .NET Programming for Beginners

I suggest that even if you belivee you have mastered the beginning material that you at least scan through it. The database stuff is in section 13 of 14. This fact alone should indicate to you that such coding requires an uderstanding of the fundamentals.

ADO.Net provides a consist set of tools to access data regardless of the data provider (SQLServer, MySql, OleDb, etc.) so it behooves you to read through this. I suggest you pay particular attention to the section on datasets. They can make your database coding a much more pleasant experience once learn how to crreate and use the through the IDE.

ADO.NET Overview

TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13

@TnTinMN: I have that ebook, found it very helpful. The free online version doesn't include the chapters about database programming, so he will have to buy the ebook.

Ancient Dragon
Achieved Level 70
Team Colleague
32,116 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68

@TnTinMN: I have that ebook, found it very helpful. The free online version doesn't include the chapters about database programming, so he will have to buy the ebook.

@AD. LOL, you made me look again, because it did the the last time I looked. I know they supposedly have more info in their e-book, but the basic stuff is still there. In any case, it would be a good low cost reference.

TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13

You are right, the free online version just doesn't include a few pages about datagrids and some other topics. In any event it is still a good introduction to vb.net programming.

Ancient Dragon
Achieved Level 70
Team Colleague
32,116 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0763 seconds using 2.72MB