public virtual DataTable GetSchema(FbConnection connection, object[] restrictions) { restrictions = this.ParseRestrictions(restrictions); FbCommand command = this.BuildCommand(connection, restrictions); FbDataAdapter adapter = new FbDataAdapter(command); DataSet dataSet = new DataSet(this.schemaName); try { adapter.Fill(dataSet, this.schemaName); } catch (Exception ex) { throw new FbException(ex.Message); } finally { adapter.Dispose(); command.Dispose(); } TrimStringFields(dataSet.Tables[this.schemaName]); return this.ProcessResult(dataSet.Tables[this.schemaName]); }
public async Task UpdateDateTest() { var dtValue = DateTime.Now; await using (var transaction = await Connection.BeginTransactionAsync()) { await using (var command = new FbCommand("select * from TEST where int_field = @int_field", Connection, transaction)) { using (var adapter = new FbDataAdapter(command)) { using (var builder = new FbCommandBuilder(adapter)) { adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; adapter.SelectCommand.Parameters.Add("@int_field", FbDbType.Integer).Value = 1; using (var ds = new DataSet()) { adapter.Fill(ds, "TEST"); Assert.AreEqual(1, ds.Tables["TEST"].Rows.Count, "Incorrect row count"); ds.Tables["TEST"].Rows[0]["DATE_FIELD"] = dtValue; adapter.Update(ds, "TEST"); } } } } await transaction.CommitAsync(); } await using (var transaction = await Connection.BeginTransactionAsync()) { await using (var command = new FbCommand("SELECT date_field FROM TEST WHERE int_field = @int_field", Connection, transaction)) { command.Parameters.Add("@int_field", FbDbType.Integer).Value = 1; var val = (DateTime)await command.ExecuteScalarAsync(); Assert.AreEqual(dtValue.Day, val.Day, "date_field has not correct day"); Assert.AreEqual(dtValue.Month, val.Month, "date_field has not correct month"); Assert.AreEqual(dtValue.Year, val.Year, "date_field has not correct year"); } await transaction.CommitAsync(); } }
public void AddProdutoBotao(long codigoBarras) { conn.ConnectionString = Properties.Settings.Default.Firebird; cmd = new FbCommand("select p.id, p.descricao, p.preco_varejo, p.codigo_barra from produtos_codigosbarras pc join produtos p on pc.id_produto = p.id where pc.codigo_barra =" + codigoBarras, conn); DA = new FbDataAdapter(cmd); DS = new DataSet(); DA.Fill(DS, "produtos_codigosbarras"); conn.Close(); txtDescricao.Text = DS.Tables["produtos_codigosbarras"].Rows[0][1].ToString(); txtValorUnitario.Text = DS.Tables["produtos_codigosbarras"].Rows[0][2].ToString(); idProduto = DS.Tables["produtos_codigosbarras"].Rows[0][0].GetHashCode(); valorUnitario = double.Parse(txtValorUnitario.Text); totalItem = valorUnitario * 1; quantidade = 1; valorComplemento = 0.0; quantidadePaga = 0.0; observacao = ""; idFuncionario = 1; if (valorUnitario > 0) { VendaComandaItem vendaComandaItem = new VendaComandaItem(idVendaComanda, idProduto, quantidade, valorUnitario, valorComplemento, totalItem, quantidadePaga, observacao, idFuncionario, produtoCodigoBarra); vendaComandaItem.Insert(); LimparComandaItem(); SelectComandaItem(idVendaComanda); } else { txtCodigoBarra.Text = ""; txtQuantidade.Text = ""; txtValorUnitario.Text = ""; txtDescricao.Text = ""; notificacao.mensagem = "Valor inválido"; notificacao.ShowDialog(); txtCodigoBarra.Focus(); } }
public void UpdateDateTest() { string sql = "select * from TEST where int_field = @int_field"; FbTransaction transaction = this.Connection.BeginTransaction(); FbCommand command = new FbCommand(sql, Connection, transaction); FbDataAdapter adapter = new FbDataAdapter(command); adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; adapter.SelectCommand.Parameters.Add("@int_field", FbDbType.Integer).Value = 1; FbCommandBuilder builder = new FbCommandBuilder(adapter); DataSet ds = new DataSet(); adapter.Fill(ds, "TEST"); Assert.AreEqual(1, ds.Tables["TEST"].Rows.Count, "Incorrect row count"); DateTime dtValue = DateTime.Now; ds.Tables["TEST"].Rows[0]["DATE_FIELD"] = dtValue; adapter.Update(ds, "TEST"); adapter.Dispose(); builder.Dispose(); command.Dispose(); transaction.Commit(); transaction = Connection.BeginTransaction(); sql = "SELECT date_field FROM TEST WHERE int_field = @int_field"; command = new FbCommand(sql, Connection, transaction); command.Parameters.Add("@int_field", FbDbType.Integer).Value = 1; DateTime val = (DateTime)command.ExecuteScalar(); transaction.Commit(); Assert.AreEqual(dtValue.Day, val.Day, "date_field has not correct day"); Assert.AreEqual(dtValue.Month, val.Month, "date_field has not correct month"); Assert.AreEqual(dtValue.Year, val.Year, "date_field has not correct year"); }
private void button1_Click(object sender, EventArgs e) { //b = a + b; FbConnectionStringBuilder cs = new FbConnectionStringBuilder(); FbConnection fbConn = new FbConnection(); // объект строки подключения cs.DataSource = "localhost"; // имя компьютера, на котором находится база данных cs.UserID = "SYSDBA"; // имя пользователя, который может производить манипуляции с базой cs.Password = "******"; // паоль пользователя, который может производить манипуляции с базой cs.Database = "C:/Users/Pepsishko/Desktop/DBLB1.FDB"; // путь к файлу базы данных // cs.Port = 3050; // порт подключения к базе cs.Charset = "win1251"; // кодировка символов string ConnString = cs.ToString(); fbConn.ConnectionString = ConnString; fbConn.Open(); DataTable dt = new DataTable(); FbDataAdapter da = new FbDataAdapter(); //FbCommand cmd = new FbCommand("select * from new_table", fbConn); // Вариант запроса с фиксированными параметрами // int a = Int32.Parse( textBox1.Text); FbCommand cmd = new FbCommand("INSERT INTO STUDENT (STUDENT_ID,SURNAME,NAME,STIPEND,KURS,CITY,UNIV_ID) VALUES (" + textBox1.Text + ",'" + textBox2.Text + "','" + textBox3.Text + "'," + textBox4.Text + "," + textBox5.Text + ",'" + textBox6.Text + "'," + textBox7.Text + ")", fbConn); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); //textBox1. DataTable dt1 = new DataTable(); FbDataAdapter da1 = new FbDataAdapter(); FbCommand cmd1 = new FbCommand("select STUDENT_ID,SURNAME,NAME,STIPEND,KURS,CITY,UNIV_ID from STUDENT", fbConn); cmd.CommandType = CommandType.Text; FbDataReader dr = cmd1.ExecuteReader(); dt.Load(dr); dataGridView1.DataSource = dt; fbConn.Close(); }
public void UpdateTimeTest() { string sql = "select * from TEST where int_field = @int_field"; FbTransaction transaction = this.Connection.BeginTransaction(); FbCommand command = new FbCommand(sql, Connection, transaction); FbDataAdapter adapter = new FbDataAdapter(command); adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; adapter.SelectCommand.Parameters.Add("@int_field", FbDbType.Integer).Value = 1; FbCommandBuilder builder = new FbCommandBuilder(adapter); DataSet ds = new DataSet(); adapter.Fill(ds, "TEST"); Assert.AreEqual(1, ds.Tables["TEST"].Rows.Count, "Incorrect row count"); TimeSpan dtValue = new TimeSpan(5, 6, 7); ds.Tables["TEST"].Rows[0]["TIME_FIELD"] = dtValue; adapter.Update(ds, "TEST"); adapter.Dispose(); builder.Dispose(); command.Dispose(); transaction.Commit(); transaction = Connection.BeginTransaction(); sql = "SELECT time_field FROM TEST WHERE int_field = @int_field"; command = new FbCommand(sql, Connection, transaction); command.Parameters.Add("@int_field", FbDbType.Integer).Value = 1; TimeSpan val = (TimeSpan)command.ExecuteScalar(); transaction.Commit(); Assert.AreEqual(dtValue.Hours, val.Hours, "time_field has not correct hour"); Assert.AreEqual(dtValue.Minutes, val.Minutes, "time_field has not correct minute"); Assert.AreEqual(dtValue.Seconds, val.Seconds, "time_field has not correct second"); }
public async Task UpdateTimeTest() { var dtValue = new TimeSpan(5, 6, 7); await using (var transaction = await Connection.BeginTransactionAsync()) { await using (var command = new FbCommand("select * from TEST where int_field = @int_field", Connection, transaction)) { using (var adapter = new FbDataAdapter(command)) { using (var builder = new FbCommandBuilder(adapter)) { adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; adapter.SelectCommand.Parameters.Add("@int_field", FbDbType.Integer).Value = 1; using (var ds = new DataSet()) { adapter.Fill(ds, "TEST"); Assert.AreEqual(1, ds.Tables["TEST"].Rows.Count, "Incorrect row count"); ds.Tables["TEST"].Rows[0]["TIME_FIELD"] = dtValue; adapter.Update(ds, "TEST"); } } } } await transaction.CommitAsync(); } await using (var transaction = await Connection.BeginTransactionAsync()) { await using (var command = new FbCommand("SELECT time_field FROM TEST WHERE int_field = @int_field", Connection, transaction)) { command.Parameters.Add("@int_field", FbDbType.Integer).Value = 1; var val = (TimeSpan)await command.ExecuteScalarAsync(); Assert.AreEqual(dtValue.Hours, val.Hours, "time_field has not correct hour"); Assert.AreEqual(dtValue.Minutes, val.Minutes, "time_field has not correct minute"); Assert.AreEqual(dtValue.Seconds, val.Seconds, "time_field has not correct second"); } await transaction.CommitAsync(); } }
private void carregaPedido() { Conexao.Active(true); try { DataTable dt = new DataTable(); FbDataAdapter da = new FbDataAdapter("SELECT PEDCODI,PEDDTEM,PEDDTBA,PEDTOTA,PEDPERC,PEDDESC,PEDLIQU,PEDCOND," + "PEDOBS,CLINOME,FUNNOME from PEDIDO P left join CLIENTE C on P.CLICODI = C.CLICODI " + "left join FUNCIONARIO F on P.FUNCODI = F.FUNCODI", Conexao.FbCnn); da.Fill(dt); if (dt.Rows.Count > 0) { dgvpedidos.DataSource = dt; } } finally { Conexao.Active(false); } }
private void carregaProduto() { Conexao.Active(true); try { DataTable dt = new DataTable(); FbDataAdapter da = new FbDataAdapter("SELECT PROCODI,PRONOME,PROCUST,PROMARG,PROVEND,PROESTO,PROLOCA,PROOBS,GRUNOME,UNINOME" + " FROM PRODUTO P left join GRUPO G on P.GRUCODI = G.GRUCODI" + " left join UNIDADE U on P.UNICODI = U.UNICODI", Conexao.FbCnn); da.Fill(dt); if (dt.Rows.Count > 0) { dgvprodutos.DataSource = dt; } } finally { Conexao.Active(false); } }
public void QueryTracker(string racion, string query, out DataTable dt) { dt = new DataTable(); try { ConnFB.Open(); FbDataAdapter da = new FbDataAdapter(query, ConnFB); DataSet ds = new DataSet(); da.Fill(ds); dt = ds.Tables[0]; } catch (DbException e) { MessageBox.Show("Error por caracteres especiales en: " + racion, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception e) { MessageBox.Show(e.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { ConnFB.Close(); } }
//Metodo para carregar dados na tabela public void CarregarDados(string script, DataGridView tabela) { sql = script; conexao.Conectar(); comando = new FbCommand(sql, conexao.conexao); try { FbDataAdapter adapter = new FbDataAdapter(comando); DataTable dt = new DataTable(); adapter.Fill(dt); tabela.DataSource = dt; Log("Carregando a tabela....."); } catch (Exception ex) { Log(ex.Message); } }
public DataTable GetData(string Query) { FbConnection Conn = this.fbConn; DataTable dt = new DataTable(); try { using (FbDataAdapter fda = new FbDataAdapter(Query, Conn)) { fda.Fill(dt); } } catch (Exception) { throw; } return(dt); }
public async Task DataAdapterFillTest() { await using (var command = new FbCommand("select * from TEST where DATE_FIELD <> ?", Connection)) { using (var adapter = new FbDataAdapter(command)) { adapter.SelectCommand.Parameters.Add("@DATE_FIELD", FbDbType.Date, 4, "DATE_FIELD").Value = new DateTime(2003, 1, 5); using (var ds = new DataSet()) { adapter.Fill(ds, "TEST"); Assert.AreEqual(1, ds.Tables.Count); Assert.Greater(ds.Tables[0].Rows.Count, 0); Assert.Greater(ds.Tables[0].Columns.Count, 0); } } } }
private void DgvDados() { Conexao.Active(true); try { DataTable dt = new DataTable(); FbDataAdapter da = new FbDataAdapter("SELECT * FROM PAIS", Conexao.FbCnn); da.Fill(dt); if (dt.Rows.Count > 0) { dgvpais.DataSource = dt; } } finally { Conexao.Active(false); } }
override public bool GetDataSet(string query, Hashtable parameters, out DataSet queryResult) { try { FbCommand cmd = new FbCommand(query, Connection, Transaction); FillParams(cmd, parameters); FbDataAdapter da = new FbDataAdapter(cmd); queryResult = new DataSet(); da.Fill(queryResult); return((queryResult != null) && (queryResult.Tables.Count > 0) && (queryResult.Tables[0].Rows.Count > 0)); } catch (Exception ex) { queryResult = null; Common.EventLogger.WriteEventError("Can't get dataset.", ex); return(false); } }
public DataSet ReadData(String sql) { FbCommand cmd = new FbCommand(sql, co); DataSet data = new DataSet(); FbDataAdapter adapter = new FbDataAdapter(sql, co); try { adapter.Fill(data); _lastError = ""; } catch (Exception e) { _lastError = e.Message; } return(data); }
/// <summary> /// get data to print chart for a method /// </summary> /// <param name="methodName">Method name</param> /// <returns></returns> public static DataTable GetMethodLogChartData(string methodName) { string commandString = @"select m.DateTime, m.TimeTaken from MethodLogs m Where m.MethodName = @methodName and m.Status = 2 order by m.Datetime asc"; FbCommand command = new FbCommand(commandString, GetConnection()); command.Parameters.Clear(); command.Parameters.Add("@methodName", methodName); DataTable dt = new DataTable(); FbDataAdapter adapter = new FbDataAdapter(command); adapter.Fill(dt); return(dt); }
public DataTable GetData(string query) { using (FbDataAdapter da = new FbDataAdapter(query, dbConnect)) { DataTable resultTable = new DataTable(); try { da.Fill(resultTable); } catch (Exception) { //написать обработчик событий на неверный запрос } return(resultTable); } }
public DataTable GetDataTableBySql(string strSQL) { if ((cn == null) || (cn.State != ConnectionState.Open)) { Open(); } DataTable dt1 = new DataTable(); //string strSQL = "select * from TRADE where STATUS=3";//TRADE ORDERS ////string strSQL = "select * from TRADEEX"; ////string strSQL = "SELECT COUNT(*) from ORDERS";//TRADE ORDERS ////SELECT COUNT(*) FROM FbDataAdapter fbDa = new FbDataAdapter(strSQL, cn); fbDa.Fill(dt1); return(dt1); }
public static DataTable GetTableByQuery(string query) { var fbdConnection = getFbdConnection(); var adapter = new FbDataAdapter(query, fbdConnection); var tab = new DataTable(); adapter.SelectCommand.Connection = fbdConnection; try { if (fbdConnection.State == ConnectionState.Closed) { fbdConnection.Open(); } adapter.Fill(tab); return(tab); } catch (Exception e) { throw e; } finally { fbdConnection.Close(); } }
private void DgvDados() { Conexao.Active(true); try { DataTable dt = new DataTable(); FbDataAdapter da = new FbDataAdapter("SELECT RAMCODI,RAMNOME,RAMOBS from RAMO", Conexao.FbCnn); da.Fill(dt); if (dt.Rows.Count > 0) { dgvramo.DataSource = dt; } } finally { Conexao.Active(false); } }
private void UcitajSredstvo() { using (FbConnection con = new FbConnection(M.Baza.connectionString)) { con.Open(); using (FbDataAdapter da = new FbDataAdapter("SELECT * FROM SREDSTVO_TROSAK WHERE SREDSTVOID = @ID", con)) { da.SelectCommand.Parameters.AddWithValue("@ID", sredstvoId); DataTable dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; } con.Close(); } }
public void Carrega(DataGridView grid) { FbDataAdapter adapter = new FbDataAdapter(); DataTable table = new DataTable(); adapter.SelectCommand = new FbCommand("select DATA, " + " USUARIO, " + " MENSAGEM " + "from MENSAGENS " + "order by DATA desc", Globais.bd); adapter.Fill(table); table.Columns[0].ColumnName = "Data"; table.Columns[1].ColumnName = "Usuário"; table.Columns[2].ColumnName = "Mensagem"; grid.DataSource = table; grid.Columns["Mensagem"].Visible = false; }
public void Carrega(DataGridView grid) { FbDataAdapter adapter = new FbDataAdapter(); DataTable table = new DataTable(); adapter.SelectCommand = new FbCommand("select COD_PRODUTO, " + " DES_PRODUTO, " + " IDT_ATIVO " + "from PRODUTOS_ACAO " + "order by COD_PRODUTO", Globais.bd); adapter.Fill(table); table.Columns[0].ColumnName = "Código"; table.Columns[1].ColumnName = "Descrição"; table.Columns[2].ColumnName = "Ativo"; grid.DataSource = table; grid.Columns["Ativo"].Width = 40; }
private void LoadEstado() { Conexao.Active(true); try { //Trazer tabela do banco para DGV DataTable dt = new DataTable(); FbDataAdapter da = new FbDataAdapter("SELECT ESTCODI,ESTUF,ESTNOME,ESTICMS,PAINOME" + " FROM ESTADOS E left join PAIS P on E.PAICODI = P.PAICODI", Conexao.FbCnn); da.Fill(dt); if (dt.Rows.Count > 0) { dgvestado.DataSource = dt; } } finally { Conexao.Active(false); } }
public DataTable DtActivos() { DataTable tabla = new DataTable(); if (_objContextoAD.Conexion.State == ConnectionState.Closed) { _objContextoAD.Conexion.Open(); } string sql = "SELECT EU.EMISOR,EU.USUARIO,E.PRIORIDAD FROM EMISORES_USUARIOS EU INNER JOIN EMISORES E ON EU.EMISOR = E.EMISOR WHERE E.ACTIVO = 1 ORDER BY EU.USUARIO, E.PRIORIDAD"; FbDataAdapter adapter = new FbDataAdapter(sql, _objContextoAD.Conexion); if (_objContextoAD.EsTransaccion) { adapter.SelectCommand.Transaction = _objContextoAD.Transaccion; } adapter.Fill(tabla); return(tabla); }
public void MultipleResultsetTest() { FbCommand command = new FbCommand("", this.Connection); command.CommandText = "select * from test;"; command.CommandText += "select int_field from test;"; command.CommandText += "select int_field, char_field from test;"; FbDataAdapter adapter = new FbDataAdapter(command); adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; DataSet ds = new DataSet(); adapter.Fill(ds); Assert.AreEqual(3, ds.Tables.Count, "Incorrect tables count"); }
//*******************// //ДОБАВЛЕНИЕ ЗНАЧЕНИЙ// //*******************// private void Button15_Click(object sender, EventArgs e) { //INSERT INTO mesto_rabotu(ID, RABOTA) VALUES(270951021, NULL); FbCommand Insert1SQL = new FbCommand("INSERT INTO mesto_rabotu(ID, RABOTA) VALUES (" + textBox16.Text + ",'" + textBox1.Text + "');", fb);; FbCommand InsertSQL = new FbCommand("INSERT INTO mesto_rabotu(ID, RABOTA) VALUES (" + textBox16.Text + ",'" + textBox1.Text + "');", fb);; FbTransaction fbt = fb.BeginTransaction(); InsertSQL.Transaction = fbt; try { int res = InsertSQL.ExecuteNonQuery(); MessageBox.Show("Выполненно: " + res.ToString()); fbt.Commit(); } catch (Exception ex) { MessageBox.Show(ex.Message); } InsertSQL.Dispose(); DataTable dt2 = new DataTable(); FbDataAdapter da2 = new FbDataAdapter(); FbCommand cmd2 = new FbCommand("SELECT base_friends.id, base_friends.name, base_friends.surname, data_friends.mesto_rabotu, mesto_rabotu.rabota from data_friends inner join base_friends on (data_friends.id = base_friends.id) inner join mesto_rabotu on (data_friends.id = mesto_rabotu.id)", fb); try { cmd2.CommandType = CommandType.Text; FbDataReader dr = cmd2.ExecuteReader(); dt2.Load(dr); } catch (Exception ex) { MessageBox.Show(ex.Message); } dataGridView1.DataSource = dt2; textBox16.Clear(); textBox17.Clear(); }
private void button2_Click_1(object sender, EventArgs e) { FbConnectionStringBuilder cs = new FbConnectionStringBuilder(); FbConnection fbConn = new FbConnection(); // объект строки подключения cs.DataSource = "localhost"; // имя компьютера, на котором находится база данных cs.UserID = "SYSDBA"; // имя пользователя, который может производить манипуляции с базой cs.Password = "******"; // паоль пользователя, который может производить манипуляции с базой cs.Database = "C:/data/DBLB1.FDB"; // путь к файлу базы данных // cs.Port = 3050; // порт подключения к базе cs.Charset = "win1251"; // кодировка символов string ConnString = cs.ToString(); fbConn.ConnectionString = ConnString; fbConn.Open(); DataTable dt = new DataTable(); FbDataAdapter da = new FbDataAdapter(); //FbCommand cmd = new FbCommand("select * from new_table", fbConn); // Вариант запроса с фиксированными параметрами // int a = Int32.Parse( textBox1.Text); FbCommand cmd = new FbCommand("DELETE FROM NEW_TABLE WHERE ID=" + textBox1.Text + "", fbConn); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); //textBox1. DataTable dt1 = new DataTable(); FbDataAdapter da1 = new FbDataAdapter(); FbCommand cmd1 = new FbCommand("select * from NEW_TABLE", fbConn); cmd.CommandType = CommandType.Text; FbDataReader dr = cmd1.ExecuteReader(); dt.Load(dr); dataGridView1.DataSource = dt; fbConn.Close(); }
public List <StageProject> getByDate(DateTime date) { FbConnection connection = null; FbCommand statement = null; String sql = "select id_stage, id_project, name_stage, u.id_user, l_name, f_name, p_name, date_begin_plan, e_mail, " + "date_end_plan, date_begin_prog, date_end_prog, date_begin_user, date_end_user, " + "status_stage, comment_user, id_stage_parent, send_message from stage_project " + "left join user_info u on u.id_user = stage_project.id_user where date_begin_plan = @date"; List <StageProject> stageProjectList = new List <StageProject>(); try { connection = daoFactory.getConnection(); statement = new FbCommand(sql, connection); statement.Parameters.Add("@date", date); FbDataAdapter da = new FbDataAdapter(statement); DataSet result = new DataSet(); da.Fill(result); foreach (DataRow row in result.Tables[0].Rows) { StageProject stageProject = generateStageProject(row); stageProject.Project = new InvestProjectDAO().getById(stageProject.IdProject); stageProjectList.Add(stageProject); } } catch (Exception e) { throw new DAOException("GetAll stage project ", e); } finally { try { if (connection != null) { connection.Close(); } } catch (System.Data.DataException e) { } } return(stageProjectList); }
public void FillTest() { FbTransaction transaction = this.Connection.BeginTransaction(); FbCommand command = new FbCommand("select * from TEST", Connection, transaction); FbDataAdapter adapter = new FbDataAdapter(command); adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; FbCommandBuilder builder = new FbCommandBuilder(adapter); DataSet ds = new DataSet(); adapter.Fill(ds, "TEST"); Assert.AreEqual(100, ds.Tables["TEST"].Rows.Count, "Incorrect row count"); Console.WriteLine(); Console.WriteLine("DataAdapter - Fill Method - Test"); foreach (DataTable table in ds.Tables) { foreach (DataColumn col in table.Columns) { Console.Write(col.ColumnName + "\t\t"); } Console.WriteLine(); foreach (DataRow row in table.Rows) { for (int i = 0; i < table.Columns.Count; i++) { Console.Write(row[i] + "\t\t"); } Console.WriteLine(""); } } adapter.Dispose(); builder.Dispose(); command.Dispose(); transaction.Commit(); }