How to select data?

  • Thread starter Thread starter Alessandro Francisco
  • Start date Start date
A

Alessandro Francisco

Hi,

I create this code #, to test a connection to Firebird SQL Server.
But i don't know fetch up the data selected, samebody can help-me?

--
Regards,

Alessandro
(e-mail address removed)
C#.Net & Firebird SQL Server

#
#region Using directives

using System;

using System.Collections.Generic;

using System.Text;

using FirebirdSql.Data.Firebird;

#endregion

namespace ConsoleApplication1

{

class Program

{

public static void Main(string[] args)

{

Console.WriteLine("<<");

//Define the connectio params, password, user, database file, and others

string connString =

"User=SYSDBA;" +

"Password=masterkey;" +

@"Database=d:\infotech.db;" + //@ to not use:"d:\\infotech.db"!

"DataSource=localhost;" +

"Dialect=3;" +

"Charset=WIN1252;";


//Start de connetion

FbConnection connInfotech = new FbConnection(connString);

connInfotech.Open();


//Create the command and transaction

FbCommand connQuery = new FbCommand();

FbTransaction transaction;

//Start local transaction

transaction = connInfotech.BeginTransaction();

//Atach connection and transaction to command

connQuery.Connection = connInfotech;

connQuery.Transaction = transaction;

connQuery.CommandText = "SELECT * FROM TB_CIDADES";

//Fileds from this table (CID_CODIGO int, CID_NOME string)

//Create de Reader ??? I don't know use this

FbDataReader dtreQuery = connQuery.ExecuteReader();

//Return record count

Console.WriteLine(dtreQuery.FieldCount);

//Close command and connection

dtreQuery.Close();

connInfotech.Close();

Console.WriteLine(">>");

}

}

}
 
Alessandro,

Please explain again in a different way the question you ask. What is it
that you mean by "fetch up the data selected" ?

Sometimes you have a grid to display data? I dont know what a Firebird SQL
server is, maybe other folks here do
 
Back
Top