Skip to main content
Un moderador ha trasladado los comentarios al chat
se añadió 1 carácter en el cuerpo
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("get_secuencia",con);
    oracommand.CommandType = CommandType.StoredProcedure;
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = (string)(oracommand.Parameters["consec"].Value.ToString();
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("get_secuencia",con);
    oracommand.CommandType = CommandType.StoredProcedure;
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = (string)(oracommand.Parameters["consec"].Value);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("get_secuencia",con);
    oracommand.CommandType = CommandType.StoredProcedure;
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = oracommand.Parameters["consec"].Value.ToString();
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();
se añadieron 63 caracteres en el cuerpo
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("get_secuencia",con);
    oracommand.CommandType = CommandType.StoredProcedure;
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = (string)(oracommand.Parameters["consec"].Value);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("get_secuencia",con);
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = (string)(oracommand.Parameters["consec"].Value);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("get_secuencia",con);
    oracommand.CommandType = CommandType.StoredProcedure;
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = (string)(oracommand.Parameters["consec"].Value);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();
se eliminaron 9 caracteres en el cuerpo
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("SQL QUERY OR PROCEDURE""get_secuencia",con);
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = (string)(oracommand.Parameters["consec"].Value);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("SQL QUERY OR PROCEDURE",con);
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = (string)(oracommand.Parameters["consec"].Value);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();

En un principio te recomiendo que quites las referencias de

System.Data.OracleClient;

y luego instales el conector de oracle

Install-Package Oracle.ManagedDataAccess -Version 12.2.1100

Luego que cambies el Connection String de esta forma

        const string _protocol = "TCP";
        const string _schema = "xx";
        const string _pswSchema = "xx";
        const string _host = "xx";
        const string _port = "1521";
        const string _serviceName = "xx";

        const string _cnnString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" + _protocol + ")(HOST=" + _host + ")"
                             + "(PORT=" + _port + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + _serviceName + ")))";

Luego en tu código

    using Oracle.ManagedDataAccess.Client;
    
    //
    var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
            {
                DataSource = _cnnString,
                UserID = _schema ,
                Password = _pswSchema 
            };

    string cnnStringFormat2 = "Data Source=" + _cnnString + ";User Id="+ _schema + ";Password="+ _pswSchema ;
    OracleConnection con = new OracleConnection(oracleConnectionStringBuilder.ToString());
    OracleCommand oracommand = new OracleCommand("get_secuencia",con);
    OracleDataReader lector;
       
    try
    {
       con.Open();
       oracommand.Parameters.Add("consec", Oracle.ManagedDataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Output;
       oracommand.ExecuteNonQuery();
       LNumDoc.Text = (string)(oracommand.Parameters["consec"].Value);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "XXXX.");
    }
    con.Close();
se añadieron 28 caracteres en el cuerpo
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23
Loading
se añadieron 108 caracteres en el cuerpo
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23
Loading
se eliminaron 16 caracteres en el cuerpo
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23
Loading
se añadieron 303 caracteres en el cuerpo
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23
Loading
se añadieron 10 caracteres en el cuerpo
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23
Loading
Origen Enlace
Luciano Montañez
  • 2.5k
  • 2
  • 10
  • 23
Loading