Last post Apr 08, 2010 04:11 AM by rakesh_nits
Apr 06, 2010 07:38 PM|raju18a|LINK
I have oracle function that return xml datatype.
My question is how i get the xml data into the string.... please urgent.........
string oracleConnectionString = ConfigurationSettings.AppSettings["connectionString"];
OracleConnection oracleconnection = new OracleConnection(oracleConnectionString);
OracleCommand oraclecommand = oracleconnection.CreateCommand();
oraclecommand.CommandText = ConfigurationSettings.AppSettings["oracle_function"];
oraclecommand.CommandType = CommandType.StoredProcedure;
oraclecommand.Connection = oracleconnection;
OracleParameter par1 = new OracleParameter("ReturnValue", OracleDbType.Xmltype);
par1.Direction = ParameterDirection.ReturnValue;
OracleParameter par = new OracleParameter("xml_status_id", OracleDbType.Int32);
par.Value = 102;
par.Direction = ParameterDirection.Input;
when i do......
I can see xml data when i do par1.value;
how do i store in the string?
Please guide me . i know i was doing wrong casting.... Suggest me the correct one
Apr 07, 2010 02:19 AM|rakesh_nits|LINK
Had you tried this
string s = par1.value as string;
Apr 07, 2010 07:51 AM|raju18a|LINK
I tried but.
for that we need to do casting because
is an object... not a string...
Please any other help......
Apr 07, 2010 08:24 AM|rakesh_nits|LINK
here (as string ) is casting only, does it give you null as the value of s? what is the type of par1.value (i.e. par1.value.GetType() what does it give you?)
what about par1.value.ToString();
what does it give you?
Is it of type OracleXmlType ,then cast it in OracleXmlType (if the above does not work try it casting in it OracleXmlType anyway)
then use the value property of the object , provided it is not null. you will find this type in Oracle.DataAccess.Types
Apr 08, 2010 04:11 AM|rakesh_nits|LINK
Sorry i see you are already doing this.
look at this thread,
Also had you done a typo in doing the casting
it should be