本文整理汇总了C#中FirebirdSql.Data.FirebirdClient.FbDataAdapter类的典型用法代码示例。如果您正苦于以下问题:C# FbDataAdapter类的具体用法?C# FbDataAdapter怎么用?C# FbDataAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FbDataAdapter类属于FirebirdSql.Data.FirebirdClient命名空间,在下文中一共展示了FbDataAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getContasPagadoras
public string getContasPagadoras(string processo)
{
string retorno = string.Empty;
string sql = "SELECT c.concod, c.connome, fr.foncod, fr.fonnome, cl.valor "+
"FROM webprocesso_contasliquidacao cl "+
"join conta c on c.concod = cl.idconta "+
"join fonterecurso fr on fr.foncod = c.confonterecurso "+
"join webprocesso proc on proc.id = cl.idprocesso "+
"where proc.numero =" + processo;
FbConnection conn = Persist.GetConn.getConn();
FbCommand cmd = new FbCommand(sql, conn);
FbDataAdapter dta = new FbDataAdapter(cmd);
System.Data.DataTable dt = new System.Data.DataTable();
dta.Fill(dt);
if (dt.Rows.Count == 0)
{
retorno = "Processo sem conta bancaria informada !!!";
ASPxGridView1.Visible = false;
ASPxRoundPanel1.Visible = true;
}
else {
ASPxRoundPanel1.Visible = false;
ASPxGridView1.DataSource = dt;
ASPxGridView1.DataBind();
}
return retorno;
}
示例2: ConsultaDataSet
public static DataSet ConsultaDataSet(string strSql)
{
abrirConn();
sqlcmd.CommandTimeout = timeout;
sqlcmd.CommandText = strSql;
DataSet dts = new DataSet();
if (!strSql.Equals(""))
{
try
{
FbDataAdapter dta = new FbDataAdapter(sqlcmd);
dta.Fill(dts);
}
catch (FbException ex)
{
for (int i = 0; i < ex.Errors.Count; i++)
{
errorMessages.Append("Index #" + i + "\n" +
"Message: " + ex.Message[i] + "\n");
}
Debug.Print(errorMessages.ToString());
Console.WriteLine(errorMessages.ToString());
}
}
fecharConn();
return dts;
}
示例3: PreencherGrid
public void PreencherGrid()
{
using (FbConnection connection = DaoBanco.GetInstancia().getConexao())
{
try
{
string mSQL = "SELECT * FROM USUARIOS";
FbCommand cmd = new FbCommand(mSQL, connection);
FbDataAdapter da = new FbDataAdapter(cmd);
dtUsuario = new DataTable();
da.Fill(dtUsuario);
this.gdUsuarios.DataSource = dtUsuario;
this.gdUsuarios.Columns["ID_USUARIO"].HeaderText = "Usuário";
this.gdUsuarios.Columns["ID_USUARIO"].Width = 70;
this.gdUsuarios.Columns["NOME"].HeaderText = "Nome";
this.gdUsuarios.Columns["NOME"].Width = 280;
this.gdUsuarios.Columns["LOGIN"].HeaderText = "Login";
this.gdUsuarios.Columns["SENHA"].Visible = false;
}
catch (FbException fbex)
{
MessageBox.Show("Erro de acesso a dados do Usuário : " + fbex.Message, "Erro");
}
}
}
示例4: PesquisaGridViewContingencia
public DataTable PesquisaGridViewContingencia(string sCampos)
{
try
{
DataTable dt = new DataTable();
string sQuery = "Select "
+ sCampos
+ " from conhecim c inner join remetent r on c.cd_remetent = r.cd_remetent"
+ " where conhecim.st_contingencia ='S' and (conhecim.st_cte='N' or conhecim.st_cte is null)";
FbDataAdapter da = new FbDataAdapter(sQuery, cx.get_Conexao());
dt.Clear();
cx.Open_Conexao();
da.Fill(dt);
da.Dispose();
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cx.Close_Conexao();
}
}
示例5: PesquisaGridView
public DataTable PesquisaGridView(string sCampos, string sWhere)
{
try
{
DataTable dt = new DataTable();
string sQuery = "Select "
+ sCampos
+ " from conhecim c inner join remetent r on c.cd_remetent = r.cd_remetent"
+ " Where " + sWhere;
FbDataAdapter da = new FbDataAdapter(sQuery, cx.get_Conexao());
dt.Clear();
cx.Open_Conexao();
da.Fill(dt);
da.Dispose();
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cx.Close_Conexao();
}
}
示例6: PreencherGrid
public void PreencherGrid()
{
using (FbConnection connection = DaoBanco.GetInstancia().getConexao())
{
try
{
string mSQL = "SELECT * FROM PECAS";
FbCommand cmd = new FbCommand(mSQL, connection);
FbDataAdapter da = new FbDataAdapter(cmd);
dtPeca = new DataTable();
da.Fill(dtPeca);
this.gdPeca.DataSource = dtPeca;
this.gdPeca.Columns["ID_PECA"].HeaderText = "Código";
this.gdPeca.Columns["ID_PECA"].Width = 70;
this.gdPeca.Columns["PECA"].HeaderText = "Peça";
this.gdPeca.Columns["PECA"].Width = 300;
this.gdPeca.Columns["OBS"].HeaderText = "Observaçoes";
this.gdPeca.Columns["OBS"].Width = 510;
}
catch (FbException fbex)
{
MessageBox.Show("Erro de acesso a dados da peça : " + fbex.Message, "Erro");
}
}
}
示例7: DeleteTest
public void DeleteTest()
{
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 = 10;
FbCommandBuilder builder = new FbCommandBuilder(adapter);
DataSet ds = new DataSet();
adapter.Fill(ds, "TEST");
Assert.AreEqual(1, ds.Tables["TEST"].Rows.Count, "Incorrect row count");
ds.Tables["TEST"].Rows[0].Delete();
adapter.Update(ds, "TEST");
adapter.Dispose();
builder.Dispose();
command.Dispose();
transaction.Commit();
}
示例8: Listar
public List<Indicador> Listar(string empresa, string filial)
{
FbCommand sqlCommand = new FbCommand();
try
{
sqlCommand.Connection = this._conexao;
sqlCommand.CommandText = "SELECT EMPRESA, FILIAL, CODIGO, DESCRICAO FROM INDICADOR "+
"WHERE ((INDICADOR.EMPRESA = @EMPRESA) OR (INDICADOR.EMPRESA = '**')) "+
"AND ((INDICADOR.FILIAL = @FILIAL) OR (INDICADOR.FILIAL = '**'))";
sqlCommand.Parameters.AddWithValue("@EMPRESA", empresa);
sqlCommand.Parameters.AddWithValue("@FILIAL", filial);
FbDataAdapter sqlAdapter = new FbDataAdapter();
sqlAdapter.SelectCommand = sqlCommand;
DataTable dtIndicador = new DataTable();
sqlAdapter.Fill(dtIndicador);
return this.ConverteDataTableEmList(dtIndicador).ToList();
}
catch (FbException ex)
{
throw ex;
}
catch (Exception ex)
{
throw ex;
}
finally
{
sqlCommand.Dispose();
}
}
示例9: BuscaDadosNF
public DataTable BuscaDadosNF()
{
DataTable dt = new DataTable();
try
{
sSQL = "SELECT " + this.sCampos + " FROM " + this.sTabela;
if (!(this.sInner.Equals(String.Empty)))
sSQL += this.sInner.ToString();
if (!(this.sWhere.Equals(String.Empty)))
sSQL += " WHERE " + this.sWhere + " ";
if (!(this.sOrder.Equals(String.Empty)))
sSQL += " ORDER BY " + this.sOrder;
FbDataAdapter Da = new FbDataAdapter(sSQL, cx.get_Conexao());
cx.Open_Conexao();
dt.Clear();
Da.Fill(dt);
Da.Dispose();
}
catch (Exception)
{
throw;
}
finally { cx.Close_Conexao(); }
return dt;
}
示例10: RetornaTabelaUsuariosCadastrados
public DataTable RetornaTabelaUsuariosCadastrados()
{
FbConnection conex = new FbConnection(conexao);
string query = "SELECT CDUSUARIO, DSUSUARIO, DSMAE, DTNASCIMENTO FROM TBUSUARIO";
FbCommand comando = new FbCommand(query, conex);
try
{
conex.Open();
FbDataAdapter datareader = new FbDataAdapter(comando);
DataTable usuarios = new DataTable();
datareader.Fill(usuarios);
return usuarios;
}
catch (Exception err)
{
throw err;
}
finally
{
conex.Close();
}
}
示例11: RetornaNomeUsuarioCadastrado
public DataTable RetornaNomeUsuarioCadastrado(string prontuario)
{
FbConnection conex = new FbConnection(conexao);
string query = "SELECT * FROM TBUSUARIO WHERE CDUSUARIO = '"+prontuario+"'";
FbCommand comando = new FbCommand(query, conex);
try
{
conex.Open();
FbDataAdapter datareader = new FbDataAdapter(comando);
DataTable usuarios = new DataTable();
datareader.Fill(usuarios);
return usuarios;
}
catch (Exception err)
{
throw err;
}
finally
{
conex.Close();
}
}
示例12: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
try
{
cadena = "User=SYSDBA;Password=masterkey;Database=C:\\Users\\Juan\\Desktop\\SAMYK\\samyk\\database.FDB;Datasource=localhost;Port=3050";
conexion = new FbConnection(cadena);
conexion.Open();
}
catch (Exception ex)
{
cadena = "User=SYSDBA;Password=masterkey;Database=C:\\Users\\Ezequiel-Pc\\Desktop\\samyk\\samyk\\database.FDB;Datasource=localhost;Port=3050";
conexion = new FbConnection(cadena);
conexion.Open();
}
try
{
MessageBox.Show("conexion establecida");
DataTable dtDatos = new DataTable();
string qry = armarQry();
FbDataAdapter mdaDatos = new FbDataAdapter(qry, conexion);
mdaDatos.Fill(dtDatos);
dataGridView1.DataSource = dtDatos;
}
catch (Exception ex)
{
MessageBox.Show("errdfsdfsdfsdfsdfsdfsdor" + ex);
}
finally
{
}
}
示例13: FbCommandBuilder
public FbCommandBuilder(FbDataAdapter adapter)
: base()
{
this.DataAdapter = adapter;
this.QuotePrefix = "\"";
this.QuoteSuffix = "\"";
this.ConflictOption = ConflictOption.OverwriteChanges;
}
示例14: GetAdapterDb
protected override DbDataAdapter GetAdapterDb(DbCommand com)
{
if (Adapter == null)
{
Adapter = new FbDataAdapter();
}
com.CommandTimeout = CommandTimeout;
Adapter.SelectCommand = com;
return Adapter;
}
示例15: EleentsToDataTable
public static DataTable EleentsToDataTable(string command)
{
var dt = new DataTable();
FbConnection con = new FbConnection(ConStr.ConnectionString);
con.Open();
FbDataAdapter da = new FbDataAdapter(command, con);
da.Fill(dt);
con.Close();
return dt;
}