Hello:
I'm making test without problems, can you tell me if this is correct
test case, please:
public static void Main(string[] args)
{
string connectionString =
@"Database=D:\TESTDB.GDB;" +
"User=SYSDBA;" +
"Password=masterkey;";
FbConnection connection = new FbConnection(connectionString);
connection.Open();
FbTransaction transaction = connection.BeginTransaction();
string commandText = "select * from TEST_TABLE_01 where int_field
= @ID";
FbCommand command = new FbCommand(commandText, connection,transaction);
command.Parameters.Add("@ID", FbType.Integer);
getNodeData(command, 1);
getNodeData(command, 2);
getNodeData(command, 3);
connection.Close();
}
public static void getNodeData(FbCommand command, int id) {
command.Parameters["@ID"].Value = id;
try
{
FbDataReader reader =
command.ExecuteReader(System.Data.CommandBehavior.SingleRow);
try
{
if (!reader.Read())
{
throw new Exception("Node not found")");
}
}
finally
{
reader.Close();
}
}
catch
{
throw;
}
}
--
Best regards
Carlos Guzmán Álvarez
Vigo-Spain
"No tengo dones especiales.Sólo soy apasionadamente curioso"
Albert Einstein, científico.
|