Results 1 to 3 of 3

Thread: Can someone help ?

  1. #1

    Thread Starter
    Member chocoloco's Avatar
    Join Date
    Mar 2006
    Posts
    42

    Can someone help ?

    What would be the equivalent of this in C#? This is Vb.NET code.

    VB Code:
    1. Dim xmlParams As String
    2.  
    3.             Dim certNum As String = "4609927"
    4.  
    5.             xmlParams = "<Root>"
    6.             xmlParams = xmlParams & "<Param Name=""p_Cert_Num"" Value=""" & certNum & """ />"
    7.             xmlParams = xmlParams & "<Param Name=""cur_CaseReqInfo"" Direction=""" & System.Data.ParameterDirection.Output & """ OraDbType=""" & System.Data.OracleClient.OracleType.Cursor & """ />"
    8.             xmlParams = xmlParams & "</Root>"

    once the xmlParams string is formed, I want to be able to load it in xmlDocument but could not build this string in C#.

  2. #2
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    Re: Can someone help ?

    string xmlParams;
    string certNum = "4609927";

    xmlParams = "<Root>";
    xmlParams += "<Root>" + "<Param Name="+"p_Cert_Num"+" Value=\"" +certNum+ "\"/>";
    xmlParams += "<Param Name="+"cur_CaseReqInfo"+" Direction=\""+ System.Data.ParameterDirection.Output+ "\" OraDbType=\"" + System.Data.OracleClient.OracleType.Cursor + "\"" />";
    xmlParams += "</Root>";

    The concatenating operator is + while the backslash character is \

  3. #3

    Thread Starter
    Member chocoloco's Avatar
    Join Date
    Mar 2006
    Posts
    42

    Re: Can someone help ?

    this worked for me ... I will try your method.

    xmlParams = "<Root>";
    xmlParams = xmlParams + "<Param Name=\"p_Cert_Num\" Value=\"" + paramValue + "\" />";
    xmlParams = xmlParams + "<Param Name=\"cur_CaseReqInfo\" Direction=\"" + Convert.ToInt32(System.Data.ParameterDirection.Output) + "\" OraDbType=\"" + Convert.ToInt64(System.Data.OracleClient.OracleType.Cursor) + "\" />";
    xmlParams = xmlParams + "</Root>";

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width