EGR 141 Computer Problem Solving in Engineering and Computer Science Interfacing with a Database in Visual Basic.NET 2005.

Slides:



Advertisements
Similar presentations
Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Advertisements

HOW TO IMPORT AND EXPORT DATA. Why do I need to use Export/Import? Here are some examples: If you have a laptop that you take home (or have a home version.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Using Microsoft Access Microsoft Access is a database program. Databases allow you to organize store and present a group of related information, for example.
BIM211 – Visual Programming Database Operations 1.
BIM313 – Advanced Programming Database Operations 1.
Chapter 14.3 LINQ to SQL Programming in Visual Basic 2010: The Very Beginner’s Guide by Jim McKeown Databases – Part 3.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Microsoft Visual Basic 2012 CHAPTER TEN Incorporating Databases with ADO.NET.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
Automating Tasks with Macros. Macro Essentials  A macro is a list of actions that happen when you run the macro.  Creating a Macro: − Choose Create.
Access Tutorial 10 Automating Tasks with Macros
From VS C# 2010 Programming, John Allwork 1 VS2010 C# Programming - DB intro 1 Topics – Database Relational - linked tables SQL ADO.NET objects Referencing.
Some Basic Database Terminology
Click to advance. ENCRYPTION WIZARD By NNN0IIC What is Encryption Wizard Archive? What does it do? How do I use it? Archive is a very useful tool whether.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
BIM211 – Visual Programming Database Operations II 1.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
Chapter 1 Databases and Database Objects: An Introduction
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
BİL528 – Bilgisayar Programlama II Database Operations II 1.
E-Manual Training Guide Electronic Manuals, called E-Manuals are easy to use and much easier to keep current than their paper counterparts. This presentation.
Microsoft Access Get a green book. Page AC 2 Define Access Define database.
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
1/36 Database Programming with Visual Basic.Net and MS Access IKE Lab. Yunho Song Database Management and Analysis.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
CIS 338: Using Queries in Access as a RecordSource Dr. Ralph D. Westfall May, 2011.
More about Databases. Data Entry through Forms Table View (Data sheet view) is useful for data entry of new records But sometimes customization would.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
Using Microsoft Access Now that data has been entered we are ready to sort or data To do this, first click on the field label which you want to sort If.
Databases with LINQ. LINQ to SQL LINQ to SQL uses LINQ syntax to query databases. LINQ to SQL classes are automatically generated by the IDE’s LINQ to.
Saving Work to Your School Server Click through this presentation at your own speed. Use it as a review or a guide while saving a project.
® Microsoft Access 2010 Tutorial 10 Automating Tasks with Macros.
O FFICE M ANAGEMENT T OOL - II B BA -V I TH. Abdus Salam2 Week-7 Introduction to Query Introduction to Query Querying from Multiple Tables Querying from.
1 Chapter 20 – Data sources and datasets Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
DataSet Your Database student test score Database Connection Your program needs to establish a connection to the database. Click on “Add New Data Source.”
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Kindle eBooks via USB on Overdrive Tutorial. eBooks.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Instructions for Uploading Points and Photos for Linking Uploading GPS points requires the following: At each site or transect note stop, “mark” a GPS.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 25 I’m Suffering from Information Overload.
Chapter 24 I’m Suffering from Information Overload (Access Databases) Clearly Visual Basic: Programming with Visual Basic nd Edition.
You may have already done this… Download the class files to the desktop Expand those files into root of USB stick Change your USB stick to drive “Z”!
Wimba Pronto Setting Pronto Preferences of the ND University System April 2009.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
Understand Databound Controls Windows Development Fundamentals LESSON 4.2A.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
VB.NET and Databases. ADO.NET VB.Net allows you many ways to connect to a database. The technology used to interact with a database or data source is.
Creating SQL Database file And Displaying a Database Table in a DataGridView.
DATA GRID VIEW objective of lecture:- After completing this lecture, you will be able to: Create a data grid view object on a windows form and use it to.
Access Tutorial 2 Building a Database and Defining Table Relationships
Microsoft Visual Basic 2010: Reloaded Fourth Edition
VB 2010 Pertemuan 10.
Basic Database Concepts
Incorporating Databases with ADO.NET
Incorporating Databases with ADO.NET
Chapter 7 Advanced Form Techniques
More about Databases.
CIS16 Application Programming with Visual Basic
Database Applications
Start a new project – since this is the community edition I will save all when I get into VB and then I can choose the location and specify a folder.
Click on Save All to save everything and choose a location etc
Presentation transcript:

EGR 141 Computer Problem Solving in Engineering and Computer Science Interfacing with a Database in Visual Basic.NET 2005

Three components Database Connection –A connection to the database file Table Adapter –A connection to a specific Table Data Set –A recordset of a Table –Can be the whole table or some subset of a table for example

Three Steps Connect to the Database Setup the Table Adapter using one or more tables Create the Data Set

Connect to the Database Click on the DataGridView control and drag and drop it on your form. We will establish a connection, setup a Table adapter, and create a dataset using this control.

Connect to the Database Using the wizard, click the pull-down arrow next to ‘Choose Data Source’ and select ‘Add Project Data Source’

Connect to the Database Select ‘Database’ and click NEXT Then, click the ‘New Connection’ button and select ‘Microsoft Access Database File’ and click ‘Continue’

Connect to the Database Using the ‘Browse’ button, search for the Database File Name. Click ‘Test Connection’ to make sure the connection works properly. Click OK

Connect to the Database If you want VB.NET 2005 to make a copy of your database in your project directory so that all of the files, including the database, are in one folder on your hard drive, click YES. I would recommend doing this so that your project can be transferred to your USB stick and other computer easily. Remember, no matter where you originally put your database file, the one that your program is using will now be in your project directory.

Connect to the Database Click Next to save the Connection to the database

Create the Table Adapter & Dataset Next, we will setup the table adapter and dataset in one step. Use the ‘plus’ sign to expand the list of Tables and select the Table(s) that we want to use in our program. Note the name of the dataset that will be created. Click Finish.

Back at the Form Back at your form, you will notice that the Data Grid shows the columns in the Data Set that was just created. More importantly, notice that 3 things have been created for you to reference in your program: Database Connection (Source) Table Adapter Data Set

Data Grid If you do not wish to use the visible Data Grid, you may turn it invisible by setting the VISIBLE property to FALSE or simply delete it from your form. The connection, adapter, and data set will remain. Database Connection (Source) Table Adapter Data Set

Objects for using the database Connection to database Connection to table A dataset to work with Notice that VB.NET added an underscore to your dataset…

Fill the Table Adapter Fill the data adapter with the dataset on the FORM LOAD event. Notice that the wizard put the code there automatically!

Code for manipulating records Using WITH we can avoid retyping _141DataSet and just start with the dot Dataset name Table name Field Name

Code for manipulating records Don’t forget to Update your Database using the Table Adapter!