本文整理汇总了C#中FirebirdSql.Data.FirebirdClient.FbDataAdapter类的典型用法代码示例。如果您正苦于以下问题:C# FbDataAdapter类的具体用法?C# FbDataAdapter怎么用?C# FbDataAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FbDataAdapter类属于FirebirdSql.Data.FirebirdClient命名空间,在下文中一共展示了FbDataAdapter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:EmersonBessa,项目名称:FluxusWeb,代码行数:35,代码来源:testeSetHtml.aspx.cs
示例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;
}
开发者ID:EmersonBessa,项目名称:FluxusWeb,代码行数:28,代码来源:AcessoDados.cs
示例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");
}
}
}
开发者ID:hugoemiliano,项目名称:DefineSis,代码行数:31,代码来源:frmUsuarios.cs
示例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();
}
}
开发者ID:dramosti,项目名称:GeraXml_2.0,代码行数:27,代码来源:daoBuscaDadosGeais.cs
示例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();
}
}
开发者ID:dramosti,项目名称:GeraXml_2.0,代码行数:26,代码来源:daoBuscaDadosGeais.cs
示例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");
}
}
}
开发者ID:hugoemiliano,项目名称:DefineSis,代码行数:30,代码来源:frmPeca.cs
示例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();
}
开发者ID:kingpong,项目名称:NETProvider,代码行数:26,代码来源:FbDataAdapterTests.cs
示例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();
}
}
开发者ID:PablusVinii,项目名称:OrdemServico,代码行数:32,代码来源:IndicadorDAO.cs
示例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;
}
开发者ID:dramosti,项目名称:GeraXml_2.0,代码行数:27,代码来源:belGerarXML.cs
示例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();
}
}
开发者ID:ribeiroluis,项目名称:SIGHOMEROGIL,代码行数:25,代码来源:PacienteFirebird.cs
示例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();
}
}
开发者ID:ribeiroluis,项目名称:SIGHOMEROGIL,代码行数:26,代码来源:AcessoFireBird.cs
示例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
{
}
}
开发者ID:Eaballay,项目名称:samyk,代码行数:35,代码来源:Form1.cs
示例13: FbCommandBuilder
public FbCommandBuilder(FbDataAdapter adapter)
: base()
{
this.DataAdapter = adapter;
this.QuotePrefix = "\"";
this.QuoteSuffix = "\"";
this.ConflictOption = ConflictOption.OverwriteChanges;
}
开发者ID:kingpong,项目名称:NETProvider,代码行数:8,代码来源:FbCommandBuilder.cs
示例14: GetAdapterDb
protected override DbDataAdapter GetAdapterDb(DbCommand com)
{
if (Adapter == null)
{
Adapter = new FbDataAdapter();
}
com.CommandTimeout = CommandTimeout;
Adapter.SelectCommand = com;
return Adapter;
}
开发者ID:codestk,项目名称:ExchangeRatesService,代码行数:10,代码来源:DataBaseFireBird.cs
示例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;
}
开发者ID:GrzesiekK126,项目名称:Wrocasion,代码行数:10,代码来源:DatabaseUtils.cs
示例16: RunSql
/// <summary>
/// 执行一段SQL查询,返回一个数据集
/// </summary>
/// <param name="sql">SQL语句</param>
/// <param name="parameters">参数</param>
/// <returns>数据集</returns>
public override System.Data.DataSet RunSql(string sql, IEnumerable<System.Data.IDbDataParameter> parameters)
{
using (var dbConnection = CreateDbConnection(true))
{
var cmd = CreateDbCommand(sql, parameters, dbConnection);
var adapter = new FbDataAdapter((FbCommand)cmd);
System.Data.DataSet dataSet = new System.Data.DataSet();
adapter.Fill(dataSet);
return dataSet;
}
}
开发者ID:mykge,项目名称:sealong.o2o,代码行数:17,代码来源:FirebirdClient.cs
示例17: Consultar
public static DataTable Consultar(string QrySql)
{
DataTable Table = new DataTable();
OpenConection();
adapter = new FbDataAdapter(QrySql, conexao);
adapter.Fill(Table);
CloseConection();
return Table;
}
开发者ID:nielson266,项目名称:Comercio,代码行数:12,代码来源:BancoDados.cs
示例18: FillEditionsList
void FillEditionsList()
{
FbCommand cmd = new FbCommand(@"select id, number, end_date, start_date, state, tickets
from get_editions_list",
_fbConnection);
FbDataAdapter da = new FbDataAdapter(cmd);
_editionsTable.Clear();
da.Fill(_editionsTable);
_editionsGrid.SetDataSource(_editionsTable);
}
开发者ID:lavr90696,项目名称:bookprognoz,代码行数:12,代码来源:EditionViewer.cs
示例19: UpdateTable
public int UpdateTable(DataSet dataSet)
{
DbCommand sQLStringCommand = db.GetSQLStringCommand("SELECT * FROM " + dataSet.Tables[0].TableName);
sQLStringCommand.Connection = db.OpenConnection();
FbDataAdapter adapter = new FbDataAdapter();
FbCommandBuilder builder = new FbCommandBuilder(adapter);
adapter.SelectCommand = (FbCommand)sQLStringCommand;
adapter.DeleteCommand = builder.GetDeleteCommand();
adapter.UpdateCommand = builder.GetUpdateCommand();
adapter.RowUpdated += new FbRowUpdatedEventHandler(adapter_RowUpdated);
return adapter.Update(dataSet.Tables[0]);
}
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:12,代码来源:frmImportFirebird.cs
示例20: ASPxGridView1_Init
protected void ASPxGridView1_Init(object sender, EventArgs e)
{
string sql = string.Empty;
DataTable dtable = new DataTable();
FbConnection conn = Persist.GetConn.getConn();
if (Request.QueryString["IDCONTA"] != null)
{
if (Request.QueryString["UNDUNIFICADO"] != null)
{
sql = "select * from vw_fluxus_agendados FA "+
"JOIN webprocesso PROC ON PROC.id = FA.procid "+
"JOIN webprocesso_contasliquidacao CL ON CL.idprocesso = PROC.id "+
"WHERE FA.temcontas IS NOT NULL "+
"AND "+
"FA.undunificado = '"+ Request.QueryString["UNDUNIFICADO"] +"' "+
"AND "+
"CL.idconta = " + Request.QueryString["IDCONTA"].ToString();
conn.Open();
FbCommand cmd = new FbCommand(sql, conn);
FbDataAdapter dta = new FbDataAdapter(cmd);
dta.Fill(dtable);
ASPxGridView1.DataSource = dtable;
ASPxGridView1.DataBind();
conn.Close();
conn.Dispose();
}
}
else {
if (Request.QueryString["UNDUNIFICADO"] != null)
{
sql = "select * from vw_fluxus_agendados FA " +
"JOIN webprocesso PROC ON PROC.id = FA.procid " +
"WHERE FA.temcontas IS NULL " +
"AND " +
"FA.undunificado = '" + Request.QueryString["UNDUNIFICADO"].ToString() + "'";
conn.Open();
FbCommand cmd = new FbCommand(sql, conn);
FbDataAdapter dta = new FbDataAdapter(cmd);
dta.Fill(dtable);
ASPxGridView1.DataSource = dtable;
ASPxGridView1.DataBind();
conn.Close();
conn.Dispose();
}
}
}
开发者ID:EmersonBessa,项目名称:FluxusWeb,代码行数:52,代码来源:detalheProcessosAgendados.aspx.cs
注:本文中的FirebirdSql.Data.FirebirdClient.FbDataAdapter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论