Visual C# Express 2010 + Firebird SQL
Posted: 29 May 2013, 2:10am - Wednesday

Requirements:

  1. Firebird .NET Provider
  2. Visual C# Express 2012
  Code:
private void Form1_Load(object sender, EventArgs e)
        {
            FbConnection con = new FbConnection("User=SYSDBA;" + "Password=masterkey;" + "Database=" + currentDir + "\\vshb.fdb;" + "DataSource=127.0.0.1;" + "Port=3050;" + "Dialect=3;" + "Charset=UTF8;");
            try  
            {
                con.Open();
                FbTransaction t = con.BeginTransaction();
                t.Commit();
                FbCommand cmd = new FbCommand("SELECT * FROM \"Bank_Branches\"", con);
                FbDataReader reader = cmd.ExecuteReader();

                textBox1.Text = "Ref. No.\t\tBranch\t\t\t\n";
                while (reader.Read())
                {
                    textBox1.AppendText(reader.GetValue(0) + "\t\t\t" + reader.GetValue(3) + "\n");
                }
                reader.Close();
                con.Close();

            }
            catch (Exception ex) 
            {
                MessageBox.Show(ex.ToString());
            }

        }
---- Sample Source: [download id="38"]