Subject | Re: [firebird-support] Visual Studio 2005 VB.NET Firebird Net Provider |
---|---|
Author | ric@atnet.it |
Post date | 2006-11-29T19:49:11Z |
[ This thread should be moved to the firebird-net-provider list -- Moderator ]
=====================================================
Add "FirebirdSql.Data.FirebirdClient" to references in "esploring solution" and to code (using ...).
A sample of code that use FbConnection and FbCommand:
private void btnSample_Click(object sender, EventArgs e)
{
FbConnection FbConn;
string cs = "Server=FbServer;Database=employee;User=SYSDBA;Password=masterkey;Dialect=3";
FbConn = new FbConnection(cs);
FbConn.Open();
FbCommand dbCommand = new FbCommand("select * from CUSTOMER", FbConn);
FbDataReader dbReader = dbCommand.ExecuteReader();
lbx1.Items.Clear(); // lbx1 is a ListBox
while (dbReader.Read() == true)
{
string row = dbReader["CUST_NO"].ToString()+"\t"+dbReader["CUSTOMER"].ToString();
lbx1.Items.Add(row);
}
FbConn.Close();
}
Ciao
Riccardo
=====================================================
Add "FirebirdSql.Data.FirebirdClient" to references in "esploring solution" and to code (using ...).
A sample of code that use FbConnection and FbCommand:
private void btnSample_Click(object sender, EventArgs e)
{
FbConnection FbConn;
string cs = "Server=FbServer;Database=employee;User=SYSDBA;Password=masterkey;Dialect=3";
FbConn = new FbConnection(cs);
FbConn.Open();
FbCommand dbCommand = new FbCommand("select * from CUSTOMER", FbConn);
FbDataReader dbReader = dbCommand.ExecuteReader();
lbx1.Items.Clear(); // lbx1 is a ListBox
while (dbReader.Read() == true)
{
string row = dbReader["CUST_NO"].ToString()+"\t"+dbReader["CUSTOMER"].ToString();
lbx1.Items.Add(row);
}
FbConn.Close();
}
Ciao
Riccardo
----- Original Message -----
From: sbdlinxg
To: firebird-support@yahoogroups.com
Sent: Wednesday, November 29, 2006 5:51 PM
Subject: [firebird-support] Visual Studio 2005 VB.NET Firebird Net Provider
Please forgive me if this is the wrong forum for this question. There
doesn't appear to be a better place for me to ask.
I need a complete code sample that shows me how connect to a Firebird
1.5 datbase using Firebird Net Provider 2.
Ideally this will be one Form and only one Button.
Right now I'm getting Type 'FbConnection' is not defined and Type
'FbCommand' is not defined errors.
Thank you
[Non-text portions of this message have been removed]