Tagged: error Toggle Comment Threads | Keyboard Shortcuts

  • montelof 8:10 am on March 9, 2011 Permalink | Reply
    Tags: error, programing   

    OCIEnvCreate failed with return code -1 but error message text was not available. 

    If anyone is getting this error it could be caused for a setting in the project properties:

    change update Database to False and the error will go away.

    • waqar hussain 2:18 am on July 26, 2011 Permalink | Reply

      project manager model property windoq, how can i open window,please help me, i am in graet trouble.

      • montelof 9:38 am on July 26, 2011 Permalink | Reply

        if you are using VS 2008 , just select the project in solution explorer, the properties window will show its properties, there, you can then change the setting for UpdateDatabase from false to True.
        hope this helps.

  • montelof 3:36 pm on September 30, 2010 Permalink | Reply
    Tags: , , development, error, , xml   

    Error processing response stream. The XML element contains mixed content. 

    Ok, in my last post I explained how to pass an array of values to the Webget method of an Ado DataService as a primitive value (csv), in this post Im going to show how to retrieve a primitive value from a Webget method avoiding the error message above.

    Lets start with the Dataservice:

    [WebGet] //we are going to return an int

    public IQueryable<int> DWTNewDownTime(int metricArrayID, string metricDate)

    {  //create the command as we used to do in 1.1

        DbCommand cmd = this.CurrentDataSource.Connection.CreateCommand();

        cmd.CommandType = CommandType.StoredProcedure;

        //add the parameters needed for the stored procedure

        EntityParameter MetricArrayID = new EntityParameter("MetricArrayID", DbType.Int16);

        MetricArrayID.Value = metricArrayID;


        EntityParameter MetricDate = new EntityParameter("MetricDate", DbType.String, 50);

        MetricDate.Value = metricDate;


        //add an output parameter, this parameter should be returned as a SELECT not return from the stored procedure

        EntityParameter Res = new EntityParameter("res", DbType.Int16, 20);

        Res.Direction = ParameterDirection.Output;


        //constructs the command text

        cmd.CommandText = string.Format(@"{0}.{1}", this.CurrentDataSource.DefaultContainerName, "DWTGetMetricValuesNewDownTimeActions");


        {//open connection and execute an scalar




        catch (System.Exception ex)


            throw new System.Exception(ex.InnerException.Message);



        {   //always close the connection


        }//return the result output value.

        List<int> _list = new List<int> { Convert.ToInt32(Res.Value) };

        return _list.AsQueryable();



    As I mention above the stored procedure should return the output parameter as SELECT.

    now lets see the ModelView:


    public void DWTGetMetricValuesNewDownTimeActions(int metricArrayID, string metricDate)

    {   //create a DataserviceQuery as we normally do for other webget methods

        QryInsertMetric = this.context.CreateQuery<int>("DWTNewDownTime")

            .AddQueryOption("MetricArrayID", metricArrayID)

            .AddQueryOption("MetricDate", "’" + metricDate + "’");

        //then create a webclient that will be used to execute the above query

        WebClient wc = new WebClient();


        wc.DownloadStringCompleted += (s, e) =>

        {   //we have to parse the returning XML

            XDocument xdoc = XDocument.Parse(e.Result);

            MetricValueID = Convert.ToInt32(xdoc.Root.Descendants(((XNamespace)@"http://schemas.microsoft.com/ado/2007/08/dataservices&quot;) + "element")

                .Select(xe => xe.Value).ToList().Single());

            //fire the property so you can catch it at your silverlight client





    Finally just catch the property change at your client:

    void Downtimemodel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)


        if (e.PropertyName == "MetricValueID")





    and that’s it, I hope this help someone get home early.

    some help from Invoking a WebGet throws an exception @ msdn

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc