Beginning MYSQL 5.0. With. Visual Studio.NET 2005



Similar documents
INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO:

Install and configure server

Using. Microsoft Virtual PC. Page 1

Sage Intelligence Financial Reporting for Sage ERP X3 Version 6.5 Installation Guide

Connect to MySQL or Microsoft SQL Server using R

How to Connect to CDL SQL Server Database via Internet

BarTender s ActiveX Automation Interface. The World's Leading Software for Label, Barcode, RFID & Card Printing

Creating a universe on Hive with Hortonworks HDP 2.0

Download and Installation of MS SQL Server

Installation Process

Installation Guide v3.0

Crystal Reports. For Visual Studio.NET. Reporting Off ADO.NET Datasets

Matisse Installation Guide for MS Windows

Upgrading from Call Center Reporting to Reporting for Contact Center. BCM Contact Center

POLICY PATROL MFT. Manual

VMware Horizon FLEX User Guide

Introduction and Overview

Matisse Installation Guide for MS Windows. 10th Edition

Installing SQL Express. For CribMaster 9.2 and Later

Connectivity Pack for Microsoft Guide

Manual POLICY PATROL SECURE FILE TRANSFER

A SharePoint Developer Introduction. Hands-On Lab. Lab Manual HOL8 Using Silverlight with the Client Object Model C#

Specops Command. Installation Guide

USERGUIDE. Introduction

How to start creating a VoIP solution with Ozeki VoIP SIP SDK

Treemap by Category Visualizations. Product: IBM Cognos Active Report Area of Interest: Reporting

VMware Horizon FLEX User Guide

Installation manual SAP Business Objects Data Services XI 3.2 on a Microsoft Windows 7-64-bit machine

VMware Horizon FLEX User Guide

Operating System Installation Guide

Trax Attendance Manager Full Installation (Windows XP, 32 bit Windows Vista, or 32 bit Windows 7)

Technical Paper. Defining an ODBC Library in SAS 9.2 Management Console Using Microsoft Windows NT Authentication

Using iscsi with BackupAssist. User Guide

DBQT - Database Query Tool Manual 1/11. Manual DBQT. Database Query Tool. Document Version: unu.ch

SQL Server 2005 Advanced settings

IIS, FTP Server and Windows

Elluminate Live! Installation and Configuration Guide

Team Foundation Server 2012 Installation Guide

How To Connect A Java To A Microsoft Database To An Ibm.Com Database On A Microsq Server On A Blackberry (Windows) Computer (Windows 2000) On A Powerpoint (Windows 5) On An Ubio.Com

Installation Guide. . All right reserved. For more information about Specops Inventory and other Specops products, visit

PaperClip. em4 Cloud Client. Setup Guide

Lepide Active Directory Self Service. Configuration Guide. Follow the simple steps given in this document to start working with

GlobalMeet powered by SoundConnect. GlobalMeet for Lync USER GUIDE

MS SQL Server 2008 Express Installation Instructions (09/27/09)

Zanibal Plug-in For Microsoft Outlook Installation & User Guide Version 1.1

Installation Guide Revision 1.0.

PaperClip. em4 Cloud Client. Manual Setup Guide

ODBC Client Driver Help Kepware, Inc.

MySQL Manager. User Guide. July 2012

Remote Desktop Services

Upgrading to Document Manager 2.7

Tutorial: How to Use SQL Server Management Studio from Home

Citrix EdgeSight for Load Testing Installation Guide. Citrix EdgeSight for Load Testing 3.8

Citrix EdgeSight Active Application Monitoring Installation Guide

SQL Server 2005: Report Builder

Team Foundation Server 2013 Installation Guide

Quick Installation Guide

MICROSTRATEGY 9.3 Supplement Files Setup Transaction Services for Dashboard and App Developers

Configuration Guide - OneDesk to SalesForce Connector

NovaBACKUP xsp Version 15.0 Upgrade Guide

Installation Guide for Pulse on Windows Server 2012

Database Migration : An In Depth look!!

SeeVogh Video Conferencing

COMMON All Day Lab 10/16/2007 Hands on VB.net and ASP.Net for iseries Developers

Measurement Studio. Contents RELEASE NOTES

QAD Enterprise Applications. Training Guide Demand Management 6.1 Technical Training

Installation Guide ARGUS Symphony 1.6 and Business App Toolkit. 6/13/ ARGUS Software, Inc.

Contents. VPN Instructions. VPN Instructions... 1

Installing Drupal on Your Local Computer

ECT362 Installing Linux Virtual Machine in KL322

Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL

Insight Video Net. LLC. CMS 2.0. Quick Installation Guide

Core Protection for Virtual Machines 1

Remote Access: Internet Explorer

PC Monitor Enterprise Server. Setup Guide

Data Collection Agent for NAS EMC Isilon Edition

Installing The SysAidTM Server Locally

Database Assistant. Once Database Assistant is installed you must login to gain access to the database. Copyright 2009

RDS Migration Tool Customer FAQ Updated 7/23/2015

How to install and use the File Sharing Outlook Plugin

1. Open Thunderbird. If the Import Wizard window opens, select Don t import anything and click Next and go to step 3.

ODBC Driver Version 4 Manual

Connecting to securevirtual Workspace

This Deployment Guide is intended for administrators in charge of planning, implementing and

Web Sites, Virtual Machines, Service Management Portal and Service Management API Beta Installation Guide

DOCSVAULT Document Management System for everyone

JAMF Software Server Installation Guide for Windows. Version 8.6

Issue Tracking Anywhere Installation Guide

FileMaker 12. ODBC and JDBC Guide

for Networks Installation Guide for the application on the server August 2014 (GUIDE 2) Lucid Exact Version 1.7-N and later

Lepide Software Asset Management

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later

M4 Systems. Remittance (ER) User Guide

PC Instructions for Miller LiveArc Software

Guide to Installing BBL Crystal MIND on Windows 7

INSTALLING MICROSOFT SQL SERVER AND CONFIGURING REPORTING SERVICES

Aradial Installation Guide

StarWind iscsi SAN Software: Using StarWind with VMware ESX Server

WEB COMPAS MINIMUM HOSTING REQUIREMENTS

Installing the MySQL ODBC Connector Windows XP and Windows 7. Roth Technologies, LLC

Transcription:

Beginning MYSQL 5.0 With Visual Studio.NET 2005 By Anil Mahadev Database Technologist and Enthusiast Welcome to the Wonderful of MYSQL 5, a phenomenal release in the History of MYSQL Development. There are a host of features to discuss, but due to the audience knowledge in mind, I will be discussing only the newer features of the MYSQL Database 5.0.

In this tutorial, I will dive into the nitty gritties of MYSQL 5 Application Development using the MYSQL Connector for.net for Visual Studio.NET 2005 and build a simple Database Application using VC# and MYSQL 5. This tutorial is a Level 200 session, which means that pre-requisite knowledge of the products is necessary. System Requirements: A basic P4 Machine with 512 MB RAM and about 40 GB HDD, a pointing device, A keyboard and a monitor. Software Requirements. Development Software Windows 2000 and above. Microsoft Visual Studio.NET 2005 (Professional or Team System). (Any edition having C# language support). Database Software MySQL Server 5.0 RC Download Link http://dev.mysql.com/downloads/mysql/5.0.html Graphical User Interface tools to help MySQL Users MySQL Administrator 1.1 http://dev.mysql.com/downloads/administrator/1.1.html MySQL Query Browser 1.1 http://dev.mysql.com/downloads/query-browser/1.1.html http://sqlmanager.net/products/mysql/manager/download

MySQL.NET and ODBC Connectors for connecting to.net ODBC Driver http://dev.mysql.com/downloads/connector/odbc/3.51.html.net Data Provider Driver http://dev.mysql.com/downloads/connector/net/1.0.html 5) Finally the urge to learn new things and adapt accordingly. Now that we have all the information and tools needed, lets build our Application and write some Code. Building our Database. Create a database called Customer. create database Customer; Create a table called Clients create table Clients ( ClientID int primary key, ClientName varchar(50), ClientEmail nvarchar(70) ); To create the above database and table, I have chosen to use the new MySQL Query Browser. In the figure shown below, is the splash screen for the Query Browser.

MySQL Query Browser This is one of the best tools ever for writing from basic SQL Statements to stored procs, triggers and UDFs. In the screen above, you can choose to enter the following info. Server Host: Localhost(By default) or your MySQL Server Name. Username: your mysql username. Password: your mysql password.

Next once the connection has been established you will see a screen as shown below. Query Browser Screen This screen enables one to create databases, tables, stored procs, triggers and UDF and execute many of the MySQL built-in functions. You can refer the code snippet above to create the database and table. Now that our database and table is created we can build our.net application and fill data into this table called client with.net To make sure our Application will perform as expected, please make sure all the software requirements are installed and ready to go. Our current objective is to just get some data from our MySQL Table that s it! We shall now launch Visual Studio 2005 and follow these steps to build our application. 1. Click on Start Microsoft Visual Studio 2005 Microsoft Visual Studio 2005 2. Now click on File New Project. Enter the details as shown in the figure below.

Enter the name: MySQL with.net 2.0 or a name of your choice. 3. Next we shall drag and drop the following controls on to the form. Place two Buttons: Name: Load and Exit A Datagrid control. Now in VS 2005, the Datagrid control is at first not visible in the data tab of the Toolbox. To add the Datagrid control right click on the Toolbox and choose Add Items And choose the Datagrid control as shown in the figure below.

4. Now that we have all our controls placed on the form, we are almost done.

5. Finally we have a screen as shown below. Sample Form In this application, we have two buttons, Load and Exit. The Load button will enable us to view the client list from our table Clients. The exit button, will help us to exit from the application. The code needed to get started are given below. 1. Please import the following Reference to your project. from the following location where you have installed your MySQL Connector for.net. Since we are using Visual Studio.NET 2005, we should import the.net 2.0 version. x:\program Files\MySQL\MySQL Connector Net 1.0.7\bin\.NET 2.0\MySql.Data.dll Replace the x with your drive letter.

This is shown in the figure below. 2. Once the reference is added in the project, you will also have to import the namespace in our form. Next type Using MYSQL.Data.MySQLClient in the Code Window

We are now set to code our application. Now type the following code for the Load Button //Load the Guest List public void LoadGuests() { try { //create a new mysqlconnection MySqlConnection mycon = new MySqlConnection("datasource=localhost;username=your userid;password=your password;database=customer"); //create a mysql DataAdapter MySqlDataAdapter myadp = new MySqlDataAdapter("Select * from clients", mycon); //create a dataset DataSet myds = new DataSet(); //now fill and bind the DataGrid myadp.fill(myds, "clients"); datagrid1.datasource = myds.tables["clients"].defaultview; datagrid1.setdatabinding(myds, "clients"); } catch (MySqlException ex) { MessageBox.Show(ex.Message); } } private void btnload_click_1(object sender, EventArgs e) { LoadGuests(); }

Now type the following code for the Exit Button private void btnexit_click_1(object sender, EventArgs e) { this.close(); } After typing all of the above code in the respective buttons. Press F5 now. And View the Result as shown in Figure 1.2 Wow!!! wasn t that easy, MySQL has a lot more features to offer its wide user base and corporate customers. I hope you have enjoyed learning MySQL with me as much as I have enjoyed writing about it. Please do drop me a line and let me know your feedback on the article, or anything in general with respect to databases. Please feel free to mail me your comments and valuable inputs on how I can write better in MYSQL and.net.

You can reach me @ Anil Mahadev anilm001@gmail.com or anil.m@dreamtekis.com MySQL Logo is Copyright of MYSQL AB Corporation and other International Countries where present. Microsoft Windows and Microsoft Visual Studio.NET logo are copyright of Microsoft Corporation, USA and other International Countries where present.