Article View: borland.public.delphi.database.dotnet
Article #47Using Firebird .NET provider
From: nostradumbass77
Date: Wed, 16 Apr 2008 10:05
Date: Wed, 16 Apr 2008 10:05
43 lines
2570 bytes
2570 bytes
Please can someone post a link(s) to example programs developed
(BDS2006) using this?
I need to get a database app developed using Firebird and C# Builder
for .NET and don't know how to get a DataSet populated with data.
Here's my code:
FbConnection cn = new FbConnection();
FbCommand cmd= new FbCommand();
DataSet ds = new DataSet();
FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
cs.DataSource = "localhost";
cs.UserID = "SYSDBA";
cs.Password = "masterkey";
cs.Database = "D:\\firebirddata\\TESTINGDB.db";
cs.Port = 3050;
cs.Charset = "UNICODE_FSS";
cs.Pooling = true;
cs.ConnectionLifeTime = 30;
// To use the embedded server set the ServerType to 1
cs.ServerType = 0;
cn.ConnectionString=cs.ConnectionString ;
cn.Open();
cmd.Connection=cn;
cmd.CommandType= CommandType.StoredProcedure;
cmd.CommandText ="EMPLOYEE_S"; //this is a SELECT stored
procedure
try{
ds = cmd.ExecuteReader(); // <----- I get
an error
message here
} catch(Exception ex) {
MessageBox.Show("Error" + ex.ToString() );
}
How do I populate the DataSet with data ???
Many thanks,
ND
Technical Details
Message-ID:
<b70df6dd-711a-40d3-bbb3-c4edfc319bcf@s13g2000prd.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!s13g2000prd.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,2ad37e90f0023977,start X-Google-Attributes: gid1effe6,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!s13g2000prd.googlegroups.com!not-for-mail From: nostradumbass77@yahoo.com Newsgroups: borland.public.delphi.database.dotnet Subject: Using Firebird .NET provider Date: Wed, 16 Apr 2008 03:05:56 -0700 (PDT) Organization: http://groups.google.com Lines: 43 Message-ID: <b70df6dd-711a-40d3-bbb3-c4edfc319bcf@s13g2000prd.googlegroups.com> NNTP-Posting-Host: 117.195.36.47 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1208340356 29947 127.0.0.1 (16 Apr 2008 10:05:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 16 Apr 2008 10:05:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s13g2000prd.googlegroups.com; posting-host=117.195.36.47; posting-account=wztKPwkAAABF5dkQ0uOXEhIE-yyuyqVz User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 uranus:3128 (squid/2.6.STABLE16)