0
Answer

Webservice Oracle and C# .net

Mohamed Ali

Mohamed Ali

11y
1.8k
1

I have written one web service for employee leave request.

 

It has 3 Web Services…

 

Two are connecting to SQL data source and 1 connecting to oracle DB.

 

Please note that the Oracle [Web method] for NOT even showing when run it on Browser whereas the  other methods are invoked. Also note that I test this connecting setting and executed in asp. C# as a application method it works.

 

Please assist me

 

 

[WebMethod]      

public DataSet Leave_balance(string empNo)

        {

 

            string oradb = "Data Source=hRPROD;UserId=HR;Password=hr;";

                //string oradb = "Data Source=(DESCRIPTION="

                //    + "(ADDRESS=(PROTOCOL=TCP)(HOST=esnaadhrsrv1)(PORT=1521))"

                //     + "(CONNECT_DATA=(SERVICE_NAME=hr1)));"

                //     + "User Id=hr;Password=hr;";

 

                OracleConnection conn = new OracleConnection();

                conn.ConnectionString = oradb;

 

                conn.Open();

 

                OracleCommand cmd = conn.CreateCommand();

                //cmd.CommandText = "Select * from emp_intranet_leave where reg_no='" + empNo + "'";

                cmd.CommandText = "Select * from emp_intranet_leave";

 

                cmd.ExecuteNonQuery();

               

    OracleDataAdapter adapter = new OracleDataAdapter(cmd);

    adapter.SelectCommand.Parameters.Add("emp_no"OracleType.Int32).Value = 2415;

    DataSet ds = new DataSet();

             

    adapter.Fill(ds);

              

 

                conn.Close();

                return (ds);

               

            }


Next Recommended Forum