Daniel Hahn wrote:
> Hello,
>
> I am eager to use Firebird within my little application. The current
> database structure contains only 2 tables, so it'll be a very small
> application. For implementation I am using Visual Basic 2005 Express
> which doesn't provide a DDEX possibility.
> In my application I want to show, add, update, delete data within a
> datagrid.
>
> Now my question - can someone provide me the most common way of
> accessing the Firebird database?
> Create a typed dataset manually, use an anonymous dataset or don't use
> datasets at all?
>
> As it is very annoying to have to maintain the datastructure in the
> database and in a dataset I don't really like the manual approach.
>
> How do you use firebird without DDEX?
>
You can create components in code, and set the appropriate properties:
con = new FbConnection();
// Here you could set it to something you've read in from a setting in
your config file
// or even if you want to construct the string correctly using
parameters, you can do
// so using the FbConnectionStringBuilder
con.ConnectionString = "";
con.Open();
if (con.State == ConnectionState.Open)
{
// Using a FbDataAdapter is relatively easy, just create the
adapter, and you may need
// in code, to create a FbCommand and set it to the DataAdapter
Select command.
// This assumes you have done this comment before in code
// ... Construction of SelectCommand etc.
FbDataAdapter1.Fill(dsMyDataSet);
// Here you can assign it to your grid, or whatever control you want
to use
// the contents of the dataset in.
mygrid.DataSource = dsMyDataSet.Tables[0];
}
I hope that is a simple quick example for you. If you aren't familiar
with using DataAdapters, Connections, etc in code, then just refer to
the MS .NET Help, as they all use the same principle, interchanging the
appropriate DataAdapters, Commands and Connections from the assembly of
the database type you are wanting to connect too.
Kind regards,
Scott :)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider