ADO.NET Installation and Usage Instructions
Go Up to ADO.NET Provider for InterBase (64-bit)
- Note: If you have previously installed RAD Studio on this computer, you do not need to perform any additional installation procedures in order to use the ADO.NET 2.0 driver with Microsoft Visual Studio 2005/2008.
- Prerequisites:
- .NET 2.0 SDK with update
- Microsoft Visual Studio 2005/2008
- InterBase XE or later
- Installation Instructions:
- Run the InterBase ADO.NET 2.0 installer.
- Usage Instructions:
- Start Visual Studio 2005/2008.
- File new C# Windows application.
- Project - Add Reference and add the AdoDbxClient.dll, DbxCommonDriver, DBXInterBaseDriver to your project.
- Add a DataGridView component to your Windows Form.
- The sample code below fills a DataGridView component with the contents of the employee table of the employee.gdb sample InterBase database:
>>> using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Borland.Data; using Borland.Data.Units; using System.Data.SqlClient; using System.Data.Common; namespace IBXEApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); ReadData(getConnection()); } public DbConnection getConnection() { // DbProviderFactory factory = DbProviderFactories.GetFactory // ("Borland.Data.AdoDbxClient"); DbConnection c = new TAdoDbx{{Product}}Connection(); //DbConnection c = factory.CreateConnection(); c.ConnectionString = "Database=C:\\Embarcadero\\{{Product}}\\examples\\database\\employee.gdb;User_Name=sysdba;Password=masterkey"; return c; } public void ReadData(DbConnection conn) { string sql = "select * from employee"; DbCommand cmd = conn.CreateCommand(); cmd.CommandText = sql; conn.Open(); DbDataReader myreader = cmd.ExecuteReader(); dataGridView1.DataSource = myreader; DataSet ds = new DataSet(); DataTable dt = new DataTable("employee"); ds.Tables.Add(dt); ds.Load(myreader, LoadOption.PreserveChanges, ds.Tables[0]); dataGridView1.DataSource = ds.Tables[0]; myreader.Close(); } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { } } } <<<