Simple MS Access operations

Slides:



Advertisements
Similar presentations
Programming with ADO.NET By Sam Nasr April 27, 2004 Programming with ADO.NET By Sam Nasr April 27, 2004.
Advertisements

Introduction to SQL, OleDB interface to Access from VB.NET.
1 Northwind Traders Order Entry. 2 Northwind Traders Call Center Add an Order Entry capability to the Northwind Traders Call Center application. Start.
Coding ADO.Net DataSet Objects ISYS 512. DataSet Object A DataSet object can hold several tables and relationships between tables. A DataSet is a set.
Session on.Net. Content Concept of.Net FrameWork.Net FrameWork Architecture.Net IDE Overview NameSpaces Exception Handling Creating Solutions & Projects.
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.
Visual Studio 2005 Using the DataGridView Control V. Matos Cleveland State University.
1 ADO.NET. 2.NET Framework Data Namespaces System.Data –Base set of classes and interfaces for ADO.NET System.Data.Common –Classes shared by the.NET Data.
Coding ADO.Net DataSet Objects. DataSet Object A DataSet object can hold several tables and relationships between tables. A DataSet is a set of disconnedted.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Coding ADO.Net DataSet Objects. DataSet Object A DataSet object can hold several tables and relationships between tables. A DataSet is a set of disconnedted.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Coding ADO.Net DataSet Objects. DataSet Object A DataSet object can hold several tables and relationships between tables. A DataSet is a set of disconnedted.
9-1 Chapter 9 Working with Databases in VB.NET. 9-2 Learning Objectives Understand how databases are used to store business data and how they differ from.
Chapter 11 Introduction to Database Processing. Class 11: Database Processing Use a Visual Studio Wizard to establish a database connection used to load.
ADO.NET By Hanumantha Rao.N MCA By Hanumantha Rao.N MCA.
ASP.NET Part 4 Instructor: Charles Moen CSCI/CINF 4230.
ITS 328 CHAPTER 3: STORING DATA IN MEMORY 1. Storing Data in Memory After today you will be able to: ◦Explain how a DataTable stores data ◦Add new data.
Advanced Visual Basic th Edition Chapter 3: Using SQL Server Databases (c) 2007 Pearson Education Inc. All rights reserved. You may modify and copy.
1/36 Database Programming with Visual Basic.Net and MS Access IKE Lab. Yunho Song Database Management and Analysis.
A Simple Introduction. What is ADO.net? First the word ADO stands for ActiveX Data Objects And it is an integral part of.Net Framework of Microsoft hence.
Database Programming Dr. John Abraham. Data Sources Data source specifies the source of the data for an application. Click on Data from Menu Choose show.
Neal Stublen Populating a Database  SQLExpress should be installed with Visual Studio  The book provides a.sql file for populating.
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
Financial Information Management Putting VB & SQL To Work Stefano Grazioli.
1 Introduction to Database Systems CSE 444 Lecture 06 SQL in C#, Project October 5, 2007.
User Interface Programming in C#: Model-View-Controller Chris North CS 3724: HCI.
ASP.NET Rina Zviel-Girshin Lecture 5
Neal Stublen Tonight’s Agenda  Database Errors  Parameterized queries  ToolStrip control  Master-detail relationships  Custom.
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
 Page_Init  Page_Load  cmdINew_Click  cmdISave_Click  cmdIDelete_Click  cmdISubmit_Click  cmdIClear_Click  gridLineItem_RowEditing  gridLineItem_RowDeleting.
ASP.NET More on searching databases 1ASP.NET, More on searching databases.
Using Adapter Wizard ISYS 512. Data Adapter Wizard – 2 nd Level of Using ADO.Net Configure Data Adapter and generating a dataset: –From the Data tab of.
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.
Module 14 Application Settings, State, and Life Cycle.
© Stefano Grazioli - Ask for permission for using/quoting:
ASP.NET - insert - delete -update DataTables (disconnected datasets) Shopping Basket.
MS Access and Database Connections. Pre-work To make our program work seamlessly, first we have to make a small change on the database table.
Accessing Data with Microsoft Visual C# Applications.
1 11/15/05CS360 Windows Programming ADO.NET Continued.
Databases – Unit 3 & 4.  SQL is not restricted to a specific database, however in class we will be looking at the two major database programmes in use.
Effective C# 50 Specific Way to Improve Your C# Item 22, 23.
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.
Module 2: Using ADO.NET to Access Data. Overview ADO.NET Architecture Creating an Application That Uses ADO.NET to Access Data Changing Database Records.
Databases Computer Technology. First Record Last Record New Record Previous Record Current Record Next Record Working with Microsoft Access (Database)
Using Database: A very, very short introduction..
Coding ADO.Net DataSet Objects ISYS 512. DataSet Object A DataSet object can hold several tables and relationships between tables. A DataSet is a set.
1 Lecture 05 Project: C#, ASP,.NET Friday, January 13, 2006.
제 21 장 : ADO.NET 을 이용한 데이터 접근. ADO.NET - DataSet 사용하기.
Database Access with SQL
Relational Model.
ADO.NET Framework.
Distributed Database Systems
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Databases Computer Technology.
MS Access and Database Connections
Lecture Set 10 Windows Controls and Forms
Databases Computer Technology.
5 × 7 = × 7 = 70 9 × 7 = CONNECTIONS IN 7 × TABLE
5 × 8 = 40 4 × 8 = 32 9 × 8 = CONNECTIONS IN 8 × TABLE
Web Service.
4 × 6 = 24 8 × 6 = 48 7 × 6 = CONNECTIONS IN 6 × TABLE
5 × 6 = 30 2 × 6 = 12 7 × 6 = CONNECTIONS IN 6 × TABLE
Chapter 10 Accessing Database Files
10 × 8 = 80 5 × 8 = 40 6 × 8 = CONNECTIONS IN 8 × TABLE MULTIPLICATION.
3 × 12 = 36 6 × 12 = 72 7 × 12 = CONNECTIONS IN 12 × TABLE
子母視窗傳值 by JS.
5 × 12 = × 12 = × 12 = CONNECTIONS IN 12 × TABLE MULTIPLICATION.
5 × 9 = 45 6 × 9 = 54 7 × 9 = CONNECTIONS IN 9 × TABLE
3 × 7 = 21 6 × 7 = 42 7 × 7 = CONNECTIONS IN 7 × TABLE
Presentation transcript:

Simple MS Access operations Monday Nov 14, 2005

Sample Application

Step One: create the database

Connecting to the Database private void Form1_Load(object sender, System.EventArgs e) { // connect to the existing Access Database string cmd = "Select name,qnty from Table1"; string connect = "provider=Microsoft.JET.OLEDB.4.0; data source = c:\\products.mdb"; myAdapter = new OleDbDataAdapter(cmd, connect); // get the data from the database DataSet mydata = new DataSet(); myAdapter.Fill (mydata, "Table1"); mytable = mydata.Tables[0]; // fill up the comboBox with the rows foreach (DataRow dataRow in mytable.Rows) comboBox1.Items.Add(dataRow["name"]); }

Really Simple Query private void btn_quantity_Click(object sender, System.EventArgs e) { // connect again string cmd = "Select name,qnty from Table1"; string connect = "provider=Microsoft.JET.OLEDB.4.0; data source = c:\\products.mdb"; myAdapter = new OleDbDataAdapter(cmd, connect); // get a fresh copy of the database DataSet mydata = new DataSet(); myAdapter.Fill (mydata, "Table1"); mytable = mydata.Tables[0]; // look for the item and show its qnty foreach (DataRow dataRow in mytable.Rows) if (String.Compare(dataRow["name"].ToString(),comboBox1.Text) == 0) MessageBox.Show("There are " + dataRow["qnty"].ToString(), }

Really Simple Remove private void btn_Delete_Click(object sender, System.EventArgs e) { // update the database foreach (DataRow dataRow in mytable.Rows) if (String.Compare(dataRow["name"].ToString(),comboBox1.Text) == 0) dataRow.Delete(); } comboBox1.Items.Remove(comboBox1.Text);