I just started learning C# in Visual Studio and I got a task to do. I have to connect to a SQL database, execute a select query and display the results using Firebird. I have read through a lot of articles, but I got stuck since everyone is telling to do a different thing. Can somebody help me and explain how this works?
using System;
using FirebirdSql.Data.FirebirdClient;
namespace ConsoleApp1
{
class Program
{
static public void Main()
{
using (var con = new FbConnection("database=SECRET.FB;user=SYSDBA;password=masterkey;DataSource=sereverip;Port=3050"))
{
con.Open();
using (var transaction = con.BeginTransaction())
{
FbCommand result = new FbCommand("SELECT n.nrdokwew, n.datadok, k.nazwaskr FROM nagl n JOIN kontrah k on (n.id_kontrah = k.id_kontrah)");
result.ExecuteNonQuery();
}
}
}
}
}