sexta-feira, 17 de julho de 2015

Oracle ;-)

Can I register correctly?

http://techapple.net/2014/12/top-7-free-android-emulators-windows-788-110-pccomputer-run-android-appsgames-windows-78-110/

set pathlibrary=D:\app\client\YOURUSER\product\12.1.0\client_1


cd %pathlibrary%\ODP.NET\bin\4\
OraProvCfg /action:gac /providerpath:Oracle.DataAccess.dll


cd %pathlibrary%\ASP.NET\bin\4\
OraProvCfg  /action:gac /providerpath:Oracle.Web.dll




using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;



public static string CreateProject(String Title, string DateStart, int TotalResources)
         {
           int RETURN_VALUE_BUFFER_SIZE = 32767;
           string bval = string.Empty;
           OracleConnection conn = new OracleConnection(“Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=IPSERVER)(PORT=YOUR_PORTSERVER)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=YOUR_SERVICE_NAME)));User Id=YOUR_ID;Password=YOUR_PASSWORD
”);
           conn.Open();

           OracleCommand cmd = new OracleCommand();
           try
           {
             cmd.Connection = conn;
             cmd.CommandText = "f_CreateProject";
             cmd.CommandType = CommandType.StoredProcedure;

             cmd.Parameters.Add("returnVal", OracleDbType.Varchar2, RETURN_VALUE_BUFFER_SIZE);
             cmd.Parameters["returnVal"].Direction = ParameterDirection.ReturnValue;

             cmd.Parameters.Add("pv_Title ", OracleDbType.Varchar2);
             cmd.Parameters["pv_Title"].Value = Title;



             cmd.Parameters.Add("pd_inicio", OracleDbType.Date);
             cmd.Parameters["pd_inicio"].Value = DateTime.ParseExact(DataInicio, "dd/MM/yyyy", CultureInfo.InvariantCulture);


             cmd.Parameters.Add("pn_TotalResources", OracleDbType.Int32);
             cmd.Parameters["pn_TotalResources"].Value = TotalResources;

                         
             cmd.ExecuteNonQuery();
             bval = cmd.Parameters["returnVal"].Value.ToString();
            
           }
            catch (Exception e)
           {

             throw e;
           }
           finally
           {
             if(cmd!=null)
              cmd.Dispose();
             if (conn != null)
             {
               conn.Close();
               conn.Dispose();
             }
           }
           return bval;

        }

 
Postar um comentário