Click here to Skip to main content
15,886,806 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get Time Tracking Application in c#.net? Pin
OriginalGriff13-Jan-15 0:53
mveOriginalGriff13-Jan-15 0:53 
AnswerRe: How to get Time Tracking Application in c#.net? Pin
CHill6013-Jan-15 2:24
mveCHill6013-Jan-15 2:24 
QuestionNeed Some suggection on E-Mail Marketing Software Pin
Er. Pradeep Kumar Rai12-Jan-15 22:36
Er. Pradeep Kumar Rai12-Jan-15 22:36 
AnswerRe: Need Some suggection on E-Mail Marketing Software Pin
OriginalGriff12-Jan-15 23:38
mveOriginalGriff12-Jan-15 23:38 
GeneralRe: Need Some suggection on E-Mail Marketing Software Pin
Er. Pradeep Kumar Rai13-Jan-15 1:34
Er. Pradeep Kumar Rai13-Jan-15 1:34 
GeneralRe: Need Some suggection on E-Mail Marketing Software Pin
OriginalGriff13-Jan-15 1:42
mveOriginalGriff13-Jan-15 1:42 
AnswerRe: Need Some suggection on E-Mail Marketing Software Pin
Chris Quinn13-Jan-15 2:30
Chris Quinn13-Jan-15 2:30 
QuestionPassing Array of custom objects as an attribute to a custom object in ODP.Net Pin
Member 960130912-Jan-15 19:55
Member 960130912-Jan-15 19:55 
From my c# code I need to pass a custom object as input parameter to my Stored Procedure in oracle. In this custom object one of the attribute is an array of custom object. So, How can pass this to Stored Procedure using ODP.Net. My code as shown below:

C#
[OracleObjectMappingAttribute("NAME")]
        public virtual string Name{get;set;}

        [OracleObjectMappingAttribute("ADDRESS")]
        public virtual string Address{get;set;}

        [OracleArrayMapping]
        //[OracleObjectMappingAttribute("AGE")]
        public virtual decimal[] Age { get; set; }
<pre> public virtual void FromCustomObject(OracleConnection objCon, IntPtr objUdt)
        {
            //The FromCustomObject method is used to build an Oracle Object or Collection from a custom object by 
            //setting attribute or element values respectively through the OracleUdt.SetValue method.
            OracleUdt.SetValue(objCon, objUdt, "NAME", this.Name);
            OracleUdt.SetValue(objCon, objUdt, "ADDRESS", this.Address);
            OracleUdt.SetValue(objCon, objUdt, "AGE", this.Age);
        }</pre>
  public virtual void ToCustomObject(OracleConnection objCon, IntPtr objUdt)
        {
            //The ToCustomObject method is used to initialize a custom object from the specified Oracle 
            //Object or Collection by retrieving attribute or element values respectively through the OracleUdt.GetValue method.
            this.Name = ((string)(OracleUdt.GetValue(objCon, objUdt, "NAME")));
            this.Address = ((string)(OracleUdt.GetValue(objCon, objUdt, "ADDRESS")));
            this.Age = ((decimal[])(OracleUdt.GetValue(objCon, objUdt, "AGE")));
        }
[OracleCustomTypeMappingAttribute("SERVICE_VATPADMIN.PERSON_TYPE")]
    public class PersonBOFactory : IOracleCustomTypeFactory 
    {
        public virtual IOracleCustomType CreateObject()
        {
            PersonBO obj = new PersonBO();
            return obj;
        }
    }
 private void btnSaveData_Click(object sender, EventArgs e)
        {
            decimal[] ageArray = { 1, 2, 3 };
                PersonBO objPersonBO = new PersonBO();
                objPersonBO.Address = "Delhi";
                objPersonBO.Age = ageArray;
                objPersonBO.Name = "Mrs.Jhon";

                // Establish the connection with Oracle
                OracleConnection objCon = new OracleConnection("Data Source=VATPD;User Id=SERVICE_VATPADMIN;Password=serV1ce_adkong0n;Persist Security Info=true;");
                objCon.Open(); // Open the connection

                // Insert the Person object into database table
                OracleCommand cmd = new OracleCommand("InsertPerson_Proc", objCon);
                cmd.CommandType = CommandType.StoredProcedure; //Database store procedure

                // Oracle Paramater
                OracleParameter objParam = new OracleParameter();
                //Denotes, we are going to pass a custom object
                objParam.OracleDbType = OracleDbType.Object;            
                objParam.Direction = ParameterDirection.Input;
                // Note: The UdtTypeName is case-senstive - Should be in upper case
                objParam.UdtTypeName = "PERSON_TYPE";
                // Attach custom object as input parameter
                objParam.Value = objPersonBO;

                //Attach parameter to command object
                cmd.Parameters.Add(objParam);

                // Insert the UDT into the table
                cmd.ExecuteNonQuery();
            //}
        }


This code is working fine if AGE is not an array.
But, how to handle this if AGE is an array.
Can anyone help me on this.

QuestionHow to get a list of all drive letters including mapped network drives Pin
robwm112-Jan-15 9:28
robwm112-Jan-15 9:28 
AnswerRe: How to get a list of all drive letters including mapped network drives Pin
OriginalGriff12-Jan-15 21:57
mveOriginalGriff12-Jan-15 21:57 
GeneralRe: How to get a list of all drive letters including mapped network drives Pin
robwm113-Jan-15 5:04
robwm113-Jan-15 5:04 
GeneralRe: How to get a list of all drive letters including mapped network drives Pin
OriginalGriff13-Jan-15 5:06
mveOriginalGriff13-Jan-15 5:06 
GeneralRe: How to get a list of all drive letters including mapped network drives Pin
robwm113-Jan-15 8:25
robwm113-Jan-15 8:25 
GeneralRe: How to get a list of all drive letters including mapped network drives Pin
OriginalGriff13-Jan-15 8:37
mveOriginalGriff13-Jan-15 8:37 
QuestionHow to plot data into the graph which is receive from com port Pin
Member 1129798112-Jan-15 3:40
Member 1129798112-Jan-15 3:40 
AnswerRe: How to plot data into the graph which is receive from com port Pin
Afzaal Ahmad Zeeshan12-Jan-15 4:24
professionalAfzaal Ahmad Zeeshan12-Jan-15 4:24 
AnswerRe: How to plot data into the graph which is receive from com port Pin
V.12-Jan-15 21:12
professionalV.12-Jan-15 21:12 
QuestionStatic constructor? Pin
TMattC11-Jan-15 20:41
TMattC11-Jan-15 20:41 
AnswerRe: Static constructor? Pin
V.11-Jan-15 20:52
professionalV.11-Jan-15 20:52 
GeneralRe: Static constructor? Pin
TMattC11-Jan-15 21:07
TMattC11-Jan-15 21:07 
GeneralRe: Static constructor? Pin
V.11-Jan-15 21:17
professionalV.11-Jan-15 21:17 
GeneralRe: Static constructor? Pin
OriginalGriff11-Jan-15 21:18
mveOriginalGriff11-Jan-15 21:18 
GeneralRe: Static constructor? Pin
V.11-Jan-15 21:22
professionalV.11-Jan-15 21:22 
GeneralRe: Static constructor? Pin
OriginalGriff11-Jan-15 21:27
mveOriginalGriff11-Jan-15 21:27 
AnswerRe: Static constructor? Pin
OriginalGriff11-Jan-15 21:17
mveOriginalGriff11-Jan-15 21:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.