VB2019 VB2017 VB2015 VB2013 VB2012 VB2010 VB2008 VB6 VB Sample Code 中文VB About Us

lesson 34 Creating Database Connection


34.1 Creating Connection to a Database using ADO.NET

We have learned how to create a database in preceding lesson. However, we need to create a connection to a database before we can access its data. Before we begin, let’s create a new database. Since we are using SQL Server 2012 as the database engine, we will use Microsoft Studio Management Express to create a database with the mdf extension.

We shall name this database file as test.mdf. After creating the database, build a table called Contacts and create two fields and name them ContactName and State respectively. Enter a few data in the table and click Save All to save the data. Now we are ready to connect to this new database.ADO.NET offers a number of connection objects such as OleDbConnection, SqlConnection and more. OleDbConnection is used to access OLEDB data such as Microsoft Access whilst SqlCOnnection is used to access data provided by Microsoft SQL server. Since we will work with SQL database in our example, we will use the SqlConnection object.

To learn the details, we suggest you grab a copy of Visual Basic 2013 Made Easy.

Price: $20.00

AUTHOR: DR. LIEW VOON KIONG

Visual Basic 2013 Made Easy is written by Dr. Liew, the webmaster of our popular online Visual Basic Tutorial, vbtutor.net. This book is a complete guide to mastering Visual Basic 2013, from beginner to intermediate programmers.  This book has been written to complement our free online Visual Basic 2013 tutorial with much more content. It is also an excellent reference text for high school or college-level computer science courses.  Reading this book will allow you to:  
  1. Understand the basic concepts of Visual Basic 2013 programming
  2. Create your own Visual Basic 2013 applications from scratch
  3. Get inspiration from a variety of interesting sample programs
  4. Modify the code samples easily to suit your needs
  5. Learn how to package and distribute your applications

Preview the Book

You need PayPal account to order this E-book. If you don't have PayPal Account, get your PayPal account by clicking the banner below:

Sign up for PayPal and start accepting credit card payments instantly.


*Please wait for 10 seconds for PayPal to redirect you to E-book Download Page after ordering and making payment. If you have problem downloading the book, please contact

admin

Mode of Delivery: Download

Warmest Regards

(Dr.Liew)

Disclaimer

This site and the products and services offered on this site are not associated, affiliated, endorsed, or sponsored by Microsoft, nor have they been reviewed tested or certified by Microsoft.

Contact Information

If you require assistant and technical support, please email

Admin




Copyright©2008 Dr.Liew Voon Kiong. All rights reserved |Contact|Privacy Policy