LinqPad - The University of Auckland
LinqPad The .NET Programmer’s Playground
 Instantly test any C#/F#/VB snippet or program
 Query databases in LINQ (or SQL) — SQL/CE/Azure, Oracle, SQLite & MySQL
 Enjoy rich output formatting, optional autocompletion and integrated debugging
 Script and automate in your favorite .NET language
1. Installing LinqPad Go to the following website:
http://www.linqpad.net/
and download the zip file, LINQPad4Setup.exe, to your desktop.
Right‐click the install .exe file and select "run as administrator". LinqPad will now be installed on your computer. To check that you have installed LinqPad correctly, run the application (a desktop) and you should see an editor window like the following appear: link should appear on your 2. Connections This manual shows you how to connect to the following databases:
 Local Microsoft SQL Server Compact database (.sdf file)
 Local Microsoft Access database (.accdb/.mdb file)
 MS SQL server 2008 database
 MySql server database
2.A) Add your connection – Local SQL Server Compact Database Microsoft SQL Server Compact (SQL CE) is a compact relational database produced by Microsoft for applications
that run on mobile devices and desktops. Prior to the introduction of the desktop platform, it was known as SQL
Server for Windows CE and SQL Server Mobile Edition.
Go through the following connections steps:
1. Click on “Add connection”
1
2. Choose “Build data context automatically” with “Default (LINQ to SQL)” and click the “Next” button.
3. Choose “Provider” with “SQL CE 4.0”. Click the “Browse” button to attach a database file.
4. Select your .sdf file and click the “Open” button.
5. You can test the connection by clicking the “Test” button.
6. Click the “OK” button to set up the connection. Now your data context is setup and ready to use.
2.B) Add your connection – Local Microsoft Access Database Note: you must install a driver for accessing Microsoft Access Database (.mdb/.accdb files). Go to the Modules page
in Canvas and download the zip file, MSAccessDataContextDriver.lpx, to your desktop.
Go through the following steps of setting the driver:
1. Click on “Add connection”
2. Click on “View more drivers...”
3. Click on “Browse” and select the .lpx file and click “OK”
2
4. The driver is added on the top list-box and ready to use. Choose the “Microsoft Access Data Contect
Driver” and Click the “Next” button to set up the connection.
5. Click the “…” button to choose your Microsoft Access database file and click the “OK” button.
6. Now, your data context is setup and ready to use.
2.C) Add your connection – MS SQL 2008 server database You should have received an e‐mail before this lecture giving you the access data to your own database on the server
studdb‐mssql08.sfac.auckland.ac.nz. Follow the steps below to set up the Remote database connection:
1.
2.
3.
4.
Click on “Add connection”
Choose “Build data context automatically” with “Default (LINQ to SQL)” and click the “Next” button.
Choose “Provider” with “SQL Server”
Enter your connection settings.
3
 Server: studdb-mssql08.sfac.auckland.ac.nz
 Choose “SQL Authentication”
 Enter User name: YOUR UPI
 Enter Password. Use the password that we e-mailed to you, not your university password!
 Database: stu_YOURUPI_COMPSCI_280_C_S2_2016 (Replace YOURUPI with your own UPI)
5. Click the “OK” button
6. Now, your data context is setup and ready to use.
2.D) Add your connection – MySql database You should have received an e‐mail before this lecture giving you the access data to your own database on the server
studdb‐mysql.fos.auckland.ac.nz. Note: you must install a driver for accessing MySql Database. Follow the steps
below to set up the Remote database connection:
Go through the following steps:
1.
2.
3.
4.
5.
6.
7.
8.
Click on “Add connection”
Click on “View more drivers...”
Choose “IQ Driver – for MySQL, SQLite, Oracle” and download the driver
Choose “Build data context automatically” with “IQ (Supports Oracle, MySQL, SQLite)” and click the
“Next” button.
Choose “Provider” with “MySql”
Enter your connection settings.
 Server: studdb-mysql.fos.auckland.ac.nz
 Database: stu_YOURUPI_COMPSCI_280_C_S2_2016 (Replace YOURUPI with your own UPI)
 User Name: YOUR UPI
 Enter Password. Use the password that we e-mailed to you, not your university password!
Click the “OK” button
Now, your data context is setup and ready to use.
3 Execute SQL Statements Go through the following steps:
1. Choose “Language” with “SQL” on the right panel and a particular connection in the “Connection” button
2. Enter a SQL statement
3. Click the “Execute” button (Green Arrow button/F5) to execute the SQL statement.
4
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising