Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- const string ConnectionString = @"
- User=SYSDBA;Password=masterkey;
- Database=D:\\firebird\KCRM.FDB;DataSource=localhost;
- Port=3050;Dialect=3;Charset=NONE;Role=;Connection lifetime=15;Pooling=true;
- MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;";
- string fbSelectCommand = @"select USER_NAME from USERS";
- using (FbConnection con = new FbConnection(ConnectionString))
- {
- con.Open();
- Console.WriteLine("Reading from FireBird DB query - {0}", fbSelectCommand);
- using (FbCommand fbCommand = new FbCommand(fbSelectCommand, con))
- {
- using (FbDataReader reader = fbCommand.ExecuteReader())
- {
- if (reader != null)
- {
- while (reader.Read())
- {
- string userName = (string)reader["USER_NAME"];
- Console.WriteLine("{0}", userName);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement