Advertisement

06.06.2008 at 03:00PM PDT, ID: 23465196
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.1

How to call an insert stored procedure from .net C# webservice. Tough good question.

Asked by mathieu_cupryk in Oracle Database, C# Programming Language, Microsoft Visual C#.Net

I have the following:

 PROCEDURE update_price_list_hdr (
        p_price_list_hdr_id             IN   price_list_hdr.price_list_hdr_id%TYPE,
        p_tough_disc_amt                IN   price_list_hdr.tough_disc_amt%TYPE,
        p_damp_disc_amt                 IN   price_list_hdr.damp_disc_amt%TYPE,
        p_stone_disc_amt                IN   price_list_hdr.stone_disc_amt%TYPE,
        p_tough_stone_disc_amt          IN   price_list_hdr.tough_stone_disc_amt%TYPE,
        p_damp_stone_disc_amt           IN   price_list_hdr.damp_stone_disc_amt%TYPE,
        p_price_list_status_type_name   IN   price_list_hdr.price_list_status_type_name%TYPE,
        p_load_dtm                      IN   price_list_hdr.load_dtm%TYPE,
        p_user_name                     IN   price_list_hdr.user_name%TYPE,
        p_wht_indr_flag                 IN   price_list_hdr.wht_indr_flag%TYPE,
        p_durum_indr_flag               IN   price_list_hdr.durum_indr_flag%TYPE,
        p_bly_indr_flag                 IN   price_list_hdr.bly_indr_flag%TYPE,
        p_desigtd_bly_indr_flag         IN   price_list_hdr.desigtd_bly_indr_flag%TYPE,
        p_load_type_name                IN   price_list_hdr.load_type_name%TYPE,
        p_wht_basis_num                 IN   price_list_hdr.wht_basis_num%TYPE,
        p_durum_basis_num               IN   price_list_hdr.durum_basis_num%TYPE,
        p_bly_basis_num                 IN   price_list_hdr.bly_basis_num%TYPE,
        p_desigtd_bly_basis_num         IN   price_list_hdr.desigtd_bly_basis_num%TYPE,
        p_src_file_path_desc            IN   price_list_hdr.src_file_path_desc%TYPE,
        p_pool_part_code                IN   price_list_hdr.pool_part_code%TYPE,
        p_sct_price_list_name           IN   price_list_hdr.sct_price_list_name%TYPE,
        p_sct_effctv_dtm                IN   price_list_hdr.sct_effctv_dtm%TYPE,
        p_row_cnt_qty                   IN   price_list_hdr.row_cnt_qty%TYPE,
        p_price_sum_amt                 IN   price_list_hdr.price_sum_amt%TYPE
    )
    IS
    BEGIN
        UPDATE price_list_hdr
           SET tough_disc_amt = p_tough_disc_amt,
               damp_disc_amt = p_damp_disc_amt,
               stone_disc_amt = p_stone_disc_amt,
               tough_stone_disc_amt = p_tough_stone_disc_amt,
               damp_stone_disc_amt = p_damp_stone_disc_amt,
               price_list_status_type_name = p_price_list_status_type_name,
               load_dtm = p_load_dtm,
               user_name = p_user_name,
               wht_indr_flag = p_wht_indr_flag,
               durum_indr_flag = p_durum_indr_flag,
               bly_indr_flag = p_bly_indr_flag,
               desigtd_bly_indr_flag = p_desigtd_bly_indr_flag,
               load_type_name = p_load_type_name,
               wht_basis_num = p_wht_basis_num,
               durum_basis_num = p_durum_basis_num,
               bly_basis_num = p_bly_basis_num,
               desigtd_bly_basis_num = p_desigtd_bly_basis_num,
               src_file_path_desc = p_src_file_path_desc,
               pool_part_code = p_pool_part_code,
               sct_price_list_name = p_sct_price_list_name,
               sct_effctv_dtm = p_sct_effctv_dtm,
               row_cnt_qty = p_row_cnt_qty,
               price_sum_amt = p_price_sum_amt
         WHERE price_list_hdr_id = p_price_list_hdr_id;
    END update_price_list_hdr;

I need to do an update from visual studio with a stored proc.
I have a snippet without using a stored proc to do a select from oracle.

private void Mode1_SaveUpdatePriceListHeader()
        {
           // Do an update on PriceListHeader
            MessageBox.Show("Updating to database");
            // PK PRICE_LIST_HDR_ID
            dr["PRICE_LIST_HDR_ID"] = txtCropYear.Text + txtListNo.Text;              //1
            //dr["TOUGH_DISC_AMT"]    =                           //2
            //dr["DAMP_DISC_AMT"]     =                           //3
            //dr["STONE_DISC_AMT"]    =                           //4
            //dr["TOUGH_STONE_DISC_AMT"] =                        //5
            //dr["DAMP_STONE_DISC_AMT"] =                         //6
            dr["PRICE_LIST_STATUS_TYPE_NAME"] =                  //7
          //  dr["LOAD_DTM"] =                                    //8 Date Loader
           
            ////dr["USER_NAME"] =                                   //9
            ////dr["WHT_INDR_FLAG"]   =                             //10
            ////dr["DURUM_INDR_FLAG"] =                             //11
            ////dr["BLY_INDR_FLAG"]   =                             //12
            ////dr["DESIGTD_BLY_INDR_FLAG"] =                       //13
           
            //dr["LOAD_TYPE_NAME"] =                              //14
           
            dr["WHT_BASIS_NUM"] = txtWheatBasis.Text == "" ? null : txtWheatBasis.Text;    //15
            dr["DURUM_BASIS_NUM"] = txtDurumBasis.Text == "" ? null : txtDurumBasis.Text;  //16
            dr["BLY_BASIS_NUM"] = txtBarleyBasis.Text == "" ? null : txtBarleyBasis.Text;  //17
            dr["DESIGTD_BLY_BASIS_NUM"] = txtDesBarleyBasis.Text == "" ? null : txtDesBarleyBasis.Text; //18
           
            ////dr["SRC_FILE_PATH_DESC"] =                        //19
            dr["POOL_PART_CODE"] = "A";                           //20
            dr["SCT_PRICE_LIST_NAME"] = txtListName.Text;         //21
            //dr["SCT_EFFCTV_DTM"] =                              //22
            //dr["ROW_CNT_QTY"] =                                 //23
            //dr["PRICE_SUM_AMT"] =                               //24
 
        }
The ones in comment I don't need to update so what do I do?

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
[WebMethod]
    public DataSet Get_Price_List_Header()
    {
        //All .NET DB connectivity requires a connection, adapter, and dataset. 
        System.Data.OracleClient.OracleConnection OracleConnection;
        System.Data.OracleClient.OracleDataAdapter OracleDataAdapter;
        DataSet OracleDataSet = new DataSet();
 
 
        //Create the connection and pass the appropriate values to connect. 
        OracleConnection = new OracleConnection("Data Source=SCWB2.WPG.CWB.CA;User ID=MXCUPRYK; Password=abcd;Integrated Security=no;");
 
 
        //The adapter will perform the actual SQL statement. 
        //The above connection string will be used as the second parameter. 
        OracleDataAdapter = new System.Data.OracleClient.OracleDataAdapter("SELECT * FROM INIT_PRICE.PRICE_LIST_HDR order by PRICE_LIST_HDR_ID", OracleConnection);
 
 
        //Fill the dataset with values from the adapters select statement. 
        OracleDataAdapter.Fill(OracleDataSet);
 
        return (OracleDataSet);
    }
[+][-]06.07.2008 at 01:33AM PDT, ID: 21734740

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Oracle Database, C# Programming Language, Microsoft Visual C#.Net
Sign Up Now!
Solution Provided By: MuhammadAdil
Participating Experts: 1
Solution Grade: B
 
 
[+][-]06.07.2008 at 08:45AM PDT, ID: 21735923

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.07.2008 at 07:26PM PDT, ID: 21737327

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628