当前位置: 首页>>代码示例>>C#>>正文


C# IDbDataAdapter.Fill方法代码示例

本文整理汇总了C#中IDbDataAdapter.Fill方法的典型用法代码示例。如果您正苦于以下问题:C# IDbDataAdapter.Fill方法的具体用法?C# IDbDataAdapter.Fill怎么用?C# IDbDataAdapter.Fill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDbDataAdapter的用法示例。


在下文中一共展示了IDbDataAdapter.Fill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Listar

        internal LsOperacao Listar()
        {
            try
              {
              var m_oOperacao = new LsOperacao();
              sbSQL.Length = 0;
              sbSQL.Append("SELECT DSAPLDOPRC, IDPRO020, NMOPRC");
              sbSQL.Append(" FROM TBPRO020");

              oAdapter = ObterDataAdapter(sbSQL.ToString());

              ITableMapping objMapping = oAdapter.TableMappings.Add("Table" , LsOperacao.tbOperacao);
              objMapping.ColumnMappings.Add("DSAPLDOPRC","Apelido");
              objMapping.ColumnMappings.Add("IDPRO020","Codigo");
              objMapping.ColumnMappings.Add("NMOPRC","Nome");

              oAdapter.Fill(m_oOperacao);

              return m_oOperacao;
              }
              catch (Exception ex)
              {
              throw new Dor.Util.OperacaoInvalidaBD(ex);
              }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:25,代码来源:rpOperacao.cs

示例2: SQLCommandBuilderExample

		public SQLCommandBuilderExample ()
		{
			var connectionDetails = 
				ConfigurationManager.ConnectionStrings ["MyDatabase"];

			var providerName = connectionDetails.ProviderName;
			var connectionString = connectionDetails.ConnectionString;
			var dbFactory = DbProviderFactories.GetFactory (providerName);   

			Adapter = dbFactory.CreateDataAdapter ();

			// Create and configure a connection
			using (var connection = dbFactory.CreateConnection ()) {

				connection.ConnectionString = connectionString;

				// Create Select Command
				var selCmd = dbFactory.CreateCommand ();
				selCmd.CommandText = "SELECT idMyTable, FieldA FROM MyTable";
				selCmd.Connection = connection;
				Adapter.SelectCommand = selCmd;

				// Create and configure DbCommandBuilder
				var builder = dbFactory.CreateCommandBuilder ();
				builder.DataAdapter = (DbDataAdapter)Adapter;

				// Create and fill a DataTable
				Adapter.Fill (DS);
			}
		}
开发者ID:caloggins,项目名称:DOT-NET-on-Linux,代码行数:30,代码来源:SQLCommandBuilderExample.cs

示例3: Listar

        internal LsUf Listar()
        {
            try
            {
                var m_oUf = new LsUf();
                sbSQL.Length = 0;
                sbSQL.Append("SELECT CDUNDDFEDR, IDPRO021, NMUNDDFEDR");
                sbSQL.Append(" FROM TBPRO021");

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", LsUf.tbUf);
                objMapping.ColumnMappings.Add("CDUNDDFEDR", LsUf.cpSigla);
                objMapping.ColumnMappings.Add("IDPRO021", LsUf.cpCodigo);
                objMapping.ColumnMappings.Add("NMUNDDFEDR", LsUf.cpNome);

                oAdapter.Fill(m_oUf);

                return m_oUf;
            }
            catch (Exception ex)
            {
                throw new Dor.Util.OperacaoInvalidaBD(ex);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:25,代码来源:rpUf.cs

示例4: Listar

        internal LsPerfilFuncao Listar()
        {
            try
            {
                var m_oPerfilFuncao = new LsPerfilFuncao();
                sbSQL.Length = 0;
                sbSQL.Append("SELECT IDDOR033, IDPRO016, IDPRO031");
                sbSQL.Append(" FROM TBPRO033");

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", LsPerfilFuncao.tbPerfilFuncao);
                objMapping.ColumnMappings.Add("IDDOR033", "Codigo");
                objMapping.ColumnMappings.Add("IDPRO016", "CodigoPerfil");
                objMapping.ColumnMappings.Add("IDPRO031", "CodigoFuncao");

                oAdapter.Fill(m_oPerfilFuncao);

                return m_oPerfilFuncao;
            }
            catch (Exception ex)
            {
                throw new Dor.Util.OperacaoInvalidaBD(ex);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:25,代码来源:rpPerfilFuncao.cs

示例5: Listar

        internal LsDireito Listar()
        {
            try
            {
                var m_oDireito = new LsDireito();
                sbSQL.Length = 0;
                sbSQL.Append("SELECT DSAPLDDIRT, IDPRO017, NMDIRT");
                sbSQL.Append(" FROM TBPRO017");

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", LsDireito.tbDireito);
                objMapping.ColumnMappings.Add("DSAPLDDIRT", LsDireito.cpApelido);
                objMapping.ColumnMappings.Add("IDPRO017", LsDireito.cpCodigo);
                objMapping.ColumnMappings.Add("NMDIRT", LsDireito.cpNome);

                oAdapter.Fill(m_oDireito);

                return m_oDireito;
            }
            catch (Exception ex)
            {
                throw new Dor.Util.OperacaoInvalidaBD(ex);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:25,代码来源:rpDireito.cs

示例6: Listar

        internal LsMenu Listar(long v_iCodigoProjeto)
        {
            try
            {
                var m_oMenu = new LsMenu();
                sbSQL.Length = 0;
                sbSQL.Append("SELECT projeto.IDPRO018, IDPRO039, IDSUBMENU, NMMENU, NMPAGN");
                sbSQL.Append(" FROM TBPRO039 menu INNER JOIN TBPRO018 projeto ON menu.IDPRO018 = projeto.IDPRO018");
                sbSQL.Append(" WHERE projeto.IDPRO018 =:IDPRO018");
                sbSQL.Append(" ORDER BY NMMENU");

                oAdapter = ObterDataAdapter(sbSQL.ToString());
                UtDbNet.AdicionarParametro(oAdapter, "IDPRO018", v_iCodigoProjeto);

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", LsMenu.tbMenu);
                objMapping.ColumnMappings.Add("IDPRO018", LsMenu.cpCodigoProjeto);
                objMapping.ColumnMappings.Add("IDPRO039", LsMenu.cpCodigo);
                objMapping.ColumnMappings.Add("IDSUBMENU", LsMenu.cpSubMenu);
                objMapping.ColumnMappings.Add("NMMENU", LsMenu.cpNome);
                objMapping.ColumnMappings.Add("NMPAGN", LsMenu.cpPagina);

                oAdapter.Fill(m_oMenu);

                return m_oMenu;
            }
            catch (Exception ex)
            {
                throw new Dor.Util.OperacaoInvalidaBD(ex);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:30,代码来源:rpMenu.cs

示例7: ListaEspecialidades

        public DataSet ListaEspecialidades()
        {
            DataSet Ds = new DataSet("DsMedicamentos");

            try
            {
                sbSQL.Length = 0;
                sbSQL.Append(" Select  DISTINCT ");
                sbSQL.Append(" dw10.dsespc, ");
                sbSQL.Append(" dw10.IDDWD010 ");
                sbSQL.Append(" From  ");
                sbSQL.Append(" TBDWD010 dw10 INNER JOIN TBDWD001 dw01 ON Substr(dw10.CLESPC,1,3) = dw01.NMMNMNUNDD ");
                sbSQL.Append("               INNER JOIN TBPRO012 pr12   ON pr12.IDDWD001 = dw01.IDDWD001 ");
                sbSQL.Append(" Where pr12.idpro012 = :UNI ");
                sbSQL.Append(" ORDER BY ");
                sbSQL.Append(" dw10.DSESPC");

                Conectar();

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                UtDbNet.AdicionarParametro(oAdapter, TratarSQLParametroBanco("UNI").ToString(), UtSessao.Empresa);

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", "DsMedicamentos");

                objMapping.ColumnMappings.Add("dsespc", "dsespc");
                objMapping.ColumnMappings.Add("IDDWD010", "IDDWD010");

                oAdapter.Fill(Ds);

                Desconectar();

                return Ds;

            }
            catch (Exception en)
            {
                m_oLog.CriarArquivoLog(en.Message, UtSessao.Sessao["UNIDADE"].ToString());
                throw new Dor.Util.OperacaoInvalidaBD(en);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:41,代码来源:rpSumario.cs

示例8: ListaExames

        public DataSet ListaExames()
        {
            DataSet Ds = new DataSet("DsMedicamentos");

            try
            {
                //Listar todos os Exames do DW de acordo com a Unidade do usuário Logado.

                sbSQL.Length = 0;

                sbSQL.Append("SELECT ");
                sbSQL.Append("PRODUTOS.IDINT106 AS IDDWD016, ");
                sbSQL.Append("' ' AS CODIGO, ");
                sbSQL.Append("TRIM(PRODUTOS.DSGRUPO) || ' - ' || TRIM(PRODUTOS.DSPROCED) AS DESCRICAO ");
                sbSQL.Append("FROM ");
                sbSQL.Append("TBINT106 PRODUTOS ");
                sbSQL.Append("WHERE ");
                sbSQL.Append("TRIM(PRODUTOS.DSGRUPO) IN(");
                sbSQL.Append("'METODOS DIAGNOSTICOS POR IMAGEM',");
                sbSQL.Append("'MEDICINA NUCLEAR',");
                sbSQL.Append("'TOMOGRAFIA COMPUTADORIZADA',");
                sbSQL.Append("'MEDICINA LABORATORIAL',");
                sbSQL.Append("'ELETROFISIOLOGICOS / MECANICOS E FUNCIONAIS',");
                sbSQL.Append("'RESSONANCIA MAGNETICA') ");
                sbSQL.Append("AND ");
                sbSQL.Append("NOT PRODUTOS.DSSUBGRP LIKE '%PROCEDIMENT%' ");
                sbSQL.Append("ORDER BY PRODUTOS.DSSUBGRP,PRODUTOS.DSPROCED ");

                //sbSQL.Append("SELECT ");
                //sbSQL.Append("PRODUTOS.IDDWD016, ");
                //sbSQL.Append("Substr(PRODUTOS.CLPRCD,10,6) AS CODIGO, ");
                //sbSQL.Append("PRODUTOS.DSPRCD AS DESCRICAO ");
                //sbSQL.Append("FROM ");
                //sbSQL.Append("TBDWD016 PRODUTOS  ");
                //sbSQL.Append("         INNER JOIN TBDWD001 UNIDADES   ON Substr(PRODUTOS.CLPRCD,1,3) = UNIDADES.NMMNMNUNDD ");
                //sbSQL.Append("         INNER JOIN TBPRO012 UNIPROCYON ON UNIDADES.IDDWD001 = UNIPROCYON.IDDWD001  ");
                //sbSQL.Append("WHERE ");
                //sbSQL.Append("PRODUTOS.FLBLQD = '0' ");
                //sbSQL.Append("AND ");
                //sbSQL.Append("PRODUTOS.IDDWD030 = 2  ");
                //sbSQL.Append("AND ");
                //sbSQL.Append("UNIPROCYON.IDPRO012 = :UNI ");
                //sbSQL.Append("ORDER BY  ");
                //sbSQL.Append("PRODUTOS.DSPRCD ");

                Conectar();

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                UtDbNet.AdicionarParametro(oAdapter, TratarSQLParametroBanco("UNI").ToString(), UtSessao.Empresa);

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", "DsMedicamentos");

                objMapping.ColumnMappings.Add("IDDWD016", "IDDWD016");
                objMapping.ColumnMappings.Add("CODIGO", "CODIGO");
                objMapping.ColumnMappings.Add("DESCRICAO", "DESCRICAO");

                oAdapter.Fill(Ds);

                Desconectar();

                return Ds;

            }
            catch (Exception en)
            {
                m_oLog.CriarArquivoLog(en.Message, UtSessao.Sessao["UNIDADE"].ToString());
                throw new Dor.Util.OperacaoInvalidaBD(en);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:70,代码来源:rpSumario.cs

示例9: Listar

        internal LsSumario_Antimicrobiano Listar()
        {
            try
              {
              var m_oSumario_Antimicrobiano = new LsSumario_Antimicrobiano();
              sbSQL.Length = 0;
              sbSQL.Append("SELECT IDINT064, IDINT058, DSANTI, DSPERI");
              sbSQL.Append(" FROM TBINT064 WHERE IDINT058 = " + Convert.ToInt32(UtSessao.Sessao["Id058"]));

              oAdapter = ObterDataAdapter(sbSQL.ToString());

              ITableMapping objMapping = oAdapter.TableMappings.Add("Table" , LsSumario_Antimicrobiano.tbSumario_Antimicrobiano);
              objMapping.ColumnMappings.Add("IDINT064",LsSumario_Antimicrobiano.cpCodigo);
              objMapping.ColumnMappings.Add("IDINT058",LsSumario_Antimicrobiano.cpidint058);
              objMapping.ColumnMappings.Add("DSANTI",LsSumario_Antimicrobiano.cpnome);
              objMapping.ColumnMappings.Add("DSPERI",LsSumario_Antimicrobiano.cpdsperi);

              oAdapter.Fill(m_oSumario_Antimicrobiano);

              return m_oSumario_Antimicrobiano;
              }
              catch (Exception en)
              {
              throw new Dor.Util.OperacaoInvalidaBD(en);
              }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:26,代码来源:rpSumario_Antimicrobiano.cs

示例10: ListaProcedimentos

        public DataSet ListaProcedimentos()
        {
            DataSet Ds = new DataSet("DsMedicamentos");

            try
            {
                //Listar todos os procedimentos do DW de acordo com a Unidade do usuário Logado.

                sbSQL.Length = 0;

                //ORIGINAL
                //sbSQL.Append("SELECT ");
                //sbSQL.Append("IDINT106 AS IDDWD016,");
                //sbSQL.Append("' ' AS CODIGO,");
                //sbSQL.Append("DSPROCED AS DESCRICAO,");
                //sbSQL.Append("' ' AS TIPO_PRODUTO ");
                //sbSQL.Append("FROM TBINT106 WHERE DSGRUPO LIKE '%PROCEDIM%' OR DSSUBGRP LIKE '%PROCEDIM%' ");
                //sbSQL.Append("ORDER BY DSPROCED");

                sbSQL.Append("SELECT ");
                sbSQL.Append("IDINT106 AS IDDWD016,");
                sbSQL.Append("' ' AS CODIGO,");
                sbSQL.Append("DSPROCED AS DESCRICAO,");
                sbSQL.Append("' ' AS TIPO_PRODUTO ");
                sbSQL.Append("FROM TBINT106 ");
                sbSQL.Append("ORDER BY DSPROCED");

                Conectar();

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                UtDbNet.AdicionarParametro(oAdapter, TratarSQLParametroBanco("UNI").ToString(), UtSessao.Empresa);

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", "DsMedicamentos");

                objMapping.ColumnMappings.Add("IDDWD016", "IDDWD016");
                objMapping.ColumnMappings.Add("CODIGO", "CODIGO");
                objMapping.ColumnMappings.Add("DESCRICAO", "DESCRICAO");
                objMapping.ColumnMappings.Add("TIPO_PRODUTO", "TIPO_PRODUTO");

                oAdapter.Fill(Ds);

                Desconectar();

                return Ds;

            }
            catch (Exception en)
            {
                m_oLog.CriarArquivoLog(en.Message, UtSessao.Sessao["UNIDADE"].ToString());
                throw new Dor.Util.OperacaoInvalidaBD(en);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:53,代码来源:rpSumario.cs

示例11: ObterReceituario

        public DataSet ObterReceituario(long m_iId058)
        {
            DataSet Ds = new DataSet("DsProcedimento");

            try
            {
                sbSQL.Length = 0;
                sbSQL.Append(" SELECT ");
                sbSQL.Append(" rece.IDINT067, ");
                sbSQL.Append(" prod.PRODUTO || ' ' || rece.OUTITM As Medicamento, ");
                sbSQL.Append(" rece.DSEMED || ' ' || rece.DSEVAL As Dose, ");
                sbSQL.Append(" rece.APREMED || ' ' || rece.APREVAL As Apresentacao, ");
                sbSQL.Append(" rece.VIAMED || ' ' || rece.VIALOCAL As Via, ");
                sbSQL.Append(" rece.FREQMED || ' ' || rece.COMPMED As Frequencia, ");
                sbSQL.Append(" rece.DURMED ||  ' ' || rece.DURVAL As Duracao, ");
                sbSQL.Append(" rece.DTULTDSE As UltimaDose ");
                sbSQL.Append(" FROM  ");
                sbSQL.Append(" TBINT067 rece LEFT JOIN TBDEF prod ON rece.IDDWD016 = prod.SEQ_MED ");
                sbSQL.Append(" WHERE ");
                sbSQL.Append(" RECE.IDINT058 = " + m_iId058);

                //sbSQL.Append(" SELECT ");
                //sbSQL.Append(" rece.IDINT067, ");
                //sbSQL.Append(" prod.DSPRCD As Medicamento, ");
                //sbSQL.Append(" rece.DSEMED || ' ' || rece.DSEVAL As Dose, ");
                //sbSQL.Append(" rece.APREMED || ' ' || rece.APREVAL As Apresentacao, ");
                //sbSQL.Append(" rece.VIAMED || ' ' || rece.VIALOCAL As Via, ");
                //sbSQL.Append(" rece.FREQMED || ' ' || rece.COMPMED As Frequencia, ");
                //sbSQL.Append(" rece.DURMED ||  ' ' || rece.DURVAL As Duracao, ");
                //sbSQL.Append(" rece.DTULTDSE As UltimaDose ");
                //sbSQL.Append(" FROM  ");
                //sbSQL.Append(" TBINT067 rece INNER JOIN TBDWD016 prod ON rece.IDDWD016 = prod.IDDWD016 ");
                //sbSQL.Append(" WHERE ");
                //sbSQL.Append(" RECE.IDINT058 = " + m_iId058);

                Conectar();

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", "DsProcedimento");

                objMapping.ColumnMappings.Add("IDINT067", "IDINT067");
                objMapping.ColumnMappings.Add("Medicamento", "Medicamento");
                objMapping.ColumnMappings.Add("Dose", "Dose");
                objMapping.ColumnMappings.Add("Apresentacao", "Apresentacao");
                objMapping.ColumnMappings.Add("Via", "Via");
                objMapping.ColumnMappings.Add("Frequencia", "Frequencia");
                objMapping.ColumnMappings.Add("Duracao", "Duracao");
                objMapping.ColumnMappings.Add("UltimaDose", "UltimaDose");

                oAdapter.Fill(Ds);

                Desconectar();

                return Ds;

            }
            catch (Exception en)
            {
                m_oLog.CriarArquivoLog(en.Message, UtSessao.Sessao["UNIDADE"].ToString());

                throw new Dor.Util.OperacaoInvalidaBD(en);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:64,代码来源:rpSumario.cs

示例12: DoInDataAdapter

            public object DoInDataAdapter(IDbDataAdapter dataAdapter)
            {
                dataAdapter.SelectCommand.CommandType = commandType;
                dataAdapter.SelectCommand.CommandText = sql;
                //TODO investigate performance of cloning....would need to change signature to
                //     DataTableMapping[] otherwise...
                foreach (DataTableMapping dataTableMapping in mappingCollection)
                {
                    dataAdapter.TableMappings.Add(((ICloneable)dataTableMapping).Clone());
                }

                ParameterUtils.CopyParameters(dataAdapter.SelectCommand, parameters);

                //TODO Review these lifecycle hooks...
                if (dataAdapterSetter != null)
                {
                    dataAdapterSetter.SetValues(dataAdapter);
                }
                if (fillLifecycleProcessor != null)
                {
                    fillLifecycleProcessor.BeforeFill(dataSet, dataAdapter.TableMappings);
                }

                int returnVal;
                if (containsDataSet)
                {
                    returnVal = dataAdapter.Fill(dataSet);
                }
                else
                {
                    //TODO should query metadata to see if supports filling dataTable directly.
                    if (dataAdapter is DbDataAdapter)
                    {
                        returnVal = ((DbDataAdapter)dataAdapter).Fill(dataTable);
                    }
                    else
                    {
                        //TODO could create DataSet and extract DataTable... for now just throw
                        throw new DataException("Provider does not support filling DataTable directly");
                    }
                }

                ParameterUtils.CopyParameters(parameters, dataAdapter.SelectCommand);

                if (fillLifecycleProcessor != null)
                {
                    fillLifecycleProcessor.AfterFill(dataSet, dataAdapter.TableMappings);
                }
                return returnVal;
            }
开发者ID:Binodesk,项目名称:spring-net,代码行数:50,代码来源:AdoTemplate.cs

示例13: ObterDSMedicoDW

        public DataSet ObterDSMedicoDW(string m_sCRM, string m_sNome)
        {
            DataSet Ds = new DataSet("DsResultado");

            try
            {
                sbSQL.Length = 0;

                sbSQL.Append(" Select DISTINCT");
                sbSQL.Append(" dw09.IDDWD009,  ");
                sbSQL.Append(" dw09.NRCONSPRFS,  ");
                sbSQL.Append(" dw04.NMPESS As NMMEDC  ");
                sbSQL.Append(" From   ");
                sbSQL.Append(" TBDWD009 dw09 INNER JOIN TBDWD005 dw05 ON dw09.CLMEDC = dw05.CLPESSFISC  ");
                sbSQL.Append("               INNER JOIN TBDWD004 dw04 ON dw05.CLPESSFISC = dw04.CLPESS ");
                sbSQL.Append("               INNER JOIN TBDWD001 dw01 ON Substr(dw09.CLMEDC,1,3) = dw01.NMMNMNUNDD ");
                sbSQL.Append("               INNER JOIN TBPRO012 pr12 ON pr12.IDDWD001 = dw01.IDDWD001 ");
                sbSQL.Append(" Where pr12.idpro012 = " + UtSessao.Empresa + " AND ");

                if (m_sCRM.Trim().Length > 0)
                {
                    sbSQL.Append(" dw09.NRCONSPRFS Like '" + m_sCRM.ToString() + "' ");
                }
                else
                {
                    sbSQL.Append(" dw04.NMPESS Like '" + m_sNome.ToString() + "' ");
                }

                Conectar();

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", "DsResultado");

                objMapping.ColumnMappings.Add("IDDWD009", "IDDWD009");
                objMapping.ColumnMappings.Add("NRCONSPRFS", "NRCONSPRFS");
                objMapping.ColumnMappings.Add("NMMEDC", "NMMEDC");

                oAdapter.Fill(Ds);

                Desconectar();

                return Ds;

            }
            catch (Exception en)
            {
                m_oLog.CriarArquivoLog(en.Message, UtSessao.Sessao["UNIDADE"].ToString());

                throw new Dor.Util.OperacaoInvalidaBD(en);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:52,代码来源:rpSumario.cs

示例14: ObterProcedimentos

        /// <summary>
        /// Obter Dados Item Receituário
        /// </summary>
        /// <param name="m_iId067"></param>
        /// <returns></returns>
        public DataSet ObterProcedimentos(long m_iId058)
        {
            DataSet Ds = new DataSet("DsProcedimento");

            try
            {
                sbSQL.Length = 0;
                sbSQL.Append(" SELECT ");
                sbSQL.Append(" proce.IDINT063, ");
                sbSQL.Append(" prod.DSPROCED || ' ' || proce.DSVALI || ' ' || proce.DSVALCARDIO  As Procedimento, ");
                sbSQL.Append(" TO_CHAR(proce.DTPRC,'DD/MM/YYYY') As Data ");
                sbSQL.Append(" FROM  ");
                sbSQL.Append(" TBINT063 proce INNER JOIN TBINT106 prod ON proce.IDDWD016 = prod.IDINT106 ");
                sbSQL.Append(" WHERE ");
                sbSQL.Append(" proce.IDINT058 = " + m_iId058);

                //sbSQL.Append(" SELECT ");
                //sbSQL.Append(" proce.IDINT063, ");
                //sbSQL.Append(" prod.DSPRCD || ' ' || proce.DSVALI || ' ' || proce.DSVALCARDIO  As Procedimento, ");
                //sbSQL.Append(" TO_CHAR(proce.DTPRC,'DD/MM/YYYY') As Data ");
                //sbSQL.Append(" FROM  ");
                //sbSQL.Append(" TBINT063 proce INNER JOIN TBDWD016 prod ON proce.IDDWD016 = prod.IDDWD016 ");
                //sbSQL.Append(" WHERE ");
                //sbSQL.Append(" proce.IDINT058 = " + m_iId058);

                Conectar();

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", "DsProcedimento");

                objMapping.ColumnMappings.Add("IDINT063", "IDINT063");
                objMapping.ColumnMappings.Add("Procedimento", "Procedimento");
                objMapping.ColumnMappings.Add("Data", "Data");

                oAdapter.Fill(Ds);

                Desconectar();

                return Ds;

            }
            catch (Exception en)
            {
                m_oLog.CriarArquivoLog(en.Message, UtSessao.Sessao["UNIDADE"].ToString());

                throw new Dor.Util.OperacaoInvalidaBD(en);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:54,代码来源:rpSumario.cs

示例15: ObterAntimicrobiano

        /// <summary>
        /// Obter Dados Antimicrobiano...
        /// </summary>
        /// <param name="m_iId058"></param>
        /// <param name="m_sTipo"></param>
        /// <returns></returns>
        public DataSet ObterAntimicrobiano(long m_iId058, string m_sTipo)
        {
            DataSet Ds = new DataSet("DsAntimicrobiano");

            try
            {
                sbSQL.Length = 0;
                sbSQL.Append(" SELECT ");
                sbSQL.Append(" anti.IDINT064, ");
                sbSQL.Append(" prod.PRODUTO As DSANTI, ");
                sbSQL.Append(" anti.DSPERI || ' ' || anti.DSVALI As DSPERI ");
                sbSQL.Append(" FROM  ");
                sbSQL.Append(" TBINT064 anti INNER JOIN TBDEF prod ON anti.IDDWD016 = prod.SEQ_MED ");
                sbSQL.Append(" WHERE ");
                sbSQL.Append(" anti.TPMED = '" + m_sTipo.Trim() + "' AND anti.IDINT058 = " + m_iId058);

                //sbSQL.Append(" SELECT ");
                //sbSQL.Append(" anti.IDINT064, ");
                //sbSQL.Append(" prod.DSPRCD As DSANTI, ");
                //sbSQL.Append(" anti.DSPERI || ' ' || anti.DSVALI As DSPERI ");
                //sbSQL.Append(" FROM  ");
                //sbSQL.Append(" TBINT064 anti INNER JOIN TBDWD016 prod ON anti.IDDWD016 = prod.IDDWD016 ");
                //sbSQL.Append(" WHERE ");
                //sbSQL.Append(" anti.TPMED = '" + m_sTipo.Trim() + "' AND anti.IDINT058 = " + m_iId058);

                Conectar();

                oAdapter = ObterDataAdapter(sbSQL.ToString());

                ITableMapping objMapping = oAdapter.TableMappings.Add("Table", "DsProcedimento");

                objMapping.ColumnMappings.Add("IDINT064", "IDINT064");
                objMapping.ColumnMappings.Add("DSANTI", "DSANTI");
                objMapping.ColumnMappings.Add("DSPERI", "DSPERI");

                oAdapter.Fill(Ds);

                Desconectar();

                return Ds;

            }
            catch (Exception en)
            {
                m_oLog.CriarArquivoLog(en.Message, UtSessao.Sessao["UNIDADE"].ToString());

                throw new Dor.Util.OperacaoInvalidaBD(en);
            }
        }
开发者ID:Workker,项目名称:SumarioDeAlta,代码行数:55,代码来源:rpSumario.cs


注:本文中的IDbDataAdapter.Fill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。