| DotNetFirebird Using Firebird SQL in .NET. |
|
Home
Features
Download
Documentation
Developer's Documentation
Connection String Parameters
Using FbConnectionStringBuilder to Build a Connection String
Connection Pooling
Create a New Database From an SQL Script
Using FbDataAdapter to Fill a Dataset
Firebird and .NET Framework Data Types Mapping
Transaction Isolation Levels
Embedded Firebird Documentation
Performance Tuning
Security
Administration
Migration to Firebird
Sample Code
FAQ
Tools and Code
About
Blog
|
Using FbDataAdapter to Fill a DatasetTEST.SQL Script (Testing Database)Run the following script to create the testing database. It creates a simple table called MYTABLE with a single row. (How to create a database from an SQL script): CREATE TABLE MYTABLE (
ID INTEGER,
VAL VARCHAR(20)
);
INSERT INTO MYTABLE (ID, VAL) VALUES (1, 'Test');
Reading valuesYou can fill an untyped DataSet using the following code: CreateEmbeddedDb(database, "test.sql");
FbConnectionStringBuilder csb = new FbConnectionStringBuilder();
csb.ServerType = 1;
csb.Database = database;
DataSet ds = new DataSet();
FbDataAdapter da = new FbDataAdapter("SELECT * FROM mytable WHERE id >= @id", csb.ToString());
da.SelectCommand.Parameters.Add("@id", 1);
da.Fill(ds);
Copyright © 2005 - 2007 DotNetFirebird |