Results 1 to 7 of 7
  1. #1
    Join Date
    May 2007
    Posts
    6

    Unanswered: Error with my request maybe OWC...

    Hi, (sorry for my english...)

    I have a probelm to build my Pivot table.

    Indeed,

    The goal is just to see an example of Table Pivot with our Database...

    For that, I use this link :

    http://www.csharphelp.com/archives4/archive623.html


    I try to adapt the code but some problems...

    I use visual developper, and i have installed OWC11 & .NET framework 2.0.

    Code:
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Microsoft.Office.Interop.Owc11;
    
    public partial class _Default : System.Web.UI.Page
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    //determine whether or not the browser supports OWC
    if(Request.Browser.ActiveXControls)
    {
    Response.Write("<OBJECT id='pTable' style='Z-INDEX: 109; LEFT: 8px; WIDTH:502px; POSITION: absolute; TOP: 8px; HEIGHT: 217px' height='217' width='502'classid='clsid:0002E55A-0000-0000-C000-000000000046'VIEWASTEXT></OBJECT>");
    //cause the object to load data on the client
    Response.Write(@"<script>document.all.pTable.ConnectionString ='" + ConfigurationManager.ConnectionStrings["TimeTrackingDB"] + "'</script>");
    Response.Write("<script>document.all.pTable.ResourceID = 'RESOURCE'</script>");
    
    PivotTableClass PTClass = new PivotTableClass();
    
    PTClass.ConnectionString = ConfigurationManager.ConnectionStrings["TimeTrackingDB"].ToString();
    PTClass.DataMember = "";
    PivotView pview = PTClass.ActiveView;
    Response.Write(pview.FieldSets.Count);
    
    }
    
    }
    }
    When i'm lauching there is an error : HRESULT E_FAIL

    http://fists148.free.fr/Error.JPG

    If i put the last lines in commentary,

    Code:
    public partial class _Default : System.Web.UI.Page
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    //determine whether or not the browser supports OWC
    if(Request.Browser.ActiveXControls)
    {
    Response.Write("<OBJECT id='pTable' style='Z-INDEX: 109; LEFT: 8px; WIDTH:502px; POSITION: absolute; TOP: 8px; HEIGHT: 217px' height='217' width='502'classid='clsid:0002E55A-0000-0000-C000-000000000046'VIEWASTEXT></OBJECT>");
    //cause the object to load data on the client
    Response.Write(@"<script>document.all.pTable.ConnectionString ='" + ConfigurationManager.ConnectionStrings["TimeTrackingDB"] + "'</script>");
    Response.Write("<script>document.all.pTable.ResourceID = 'RESOURCE'</script>");
    
    }
    
    }
    }
    The component is loading but it seems to be an issue with the connection database...

    In my web.config, I Have this :

    Code:
    <connectionStrings>
    		<add name="TimeTrackingDB" connectionString="Data Source=PORT06139\DEV_2000;Initial Catalog=TimeTracking;Persist Security Info=True;User ID=user_TTT;Password=user_TTT;pooling=false"/>
    		
    	</connectionStrings>
    Error connection

    If you have any idea, i take it...I'm deseperate

    Thanks By advance
    Last edited by fists; 06-04-07 at 08:36.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Lets find out whether this is a problem with your pivot tool, or your server connection.
    Unfortunately, I can only help you trouble-shoot the connection as I know little or nothing about your application coding.
    Are you using SQL Server authentication or Windows authentication to connect to your database server?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I don't much fancy handling the app code either but.... there is an error within the class that is not handled with an exceptioon handler hence you get the call to the property highlighted. Use the debugging tools to step through the code line by line - it will take you through the class and then will error once more at the actual line within the class that is throwing the exception. This might not help us fix the problem but at least let you know if we are capable of fixing the problem or if you need to speak to more .NET enabled people
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    May 2007
    Posts
    6
    Thanks for your answer.

    Nevertheless I believe it's a problem of SQL..

    Indeed, in my web.config, we use this connection string in our overall project and we haven't got any issue with this.

    That's why I think there is a mistake in the script of creation of the pivot.

    If anybody see this mistake or think to another issue, please let me know.

    (Sorry for my very bad english... )

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by fists
    Nevertheless I believe it's a problem of SQL..

    Indeed, in my web.config, we use this connection string in our overall project and we haven't got any issue with this.

    That's why I think there is a mistake in the script of creation of the pivot.
    Well if your class is creating invalid SQL then it really is a c# problem rather than a SQL one. As mentioned - the error is to do with your class. Without delving around in your class you are not going to get anywhere. Your code does pretty well nothing but retrieve a connection string, submit it to the class, call a class property and report an error in the class. If you say the connection string is wrong then there is nothing to do but step through your code.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    May 2007
    Posts
    6
    Thanks for the interest of my issue

    As i have say, i test just to put this :

    Code:
    public partial class _Default : System.Web.UI.Page
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    //determine whether or not the browser supports OWC
    if(Request.Browser.ActiveXControls)
    {
    Response.Write("<OBJECT id='pTable' style='Z-INDEX: 109; LEFT: 8px; WIDTH:502px; POSITION: absolute; TOP: 8px; HEIGHT: 217px' height='217' width='502'classid='clsid:0002E55A-0000-0000-C000-000000000046'VIEWASTEXT></OBJECT>");
    //cause the object to load data on the client
    Response.Write(@"<script>document.all.pTable.ConnectionString ='" + ConfigurationManager.ConnectionStrings["TimeTrackingDB"] + "'</script>");
    Response.Write("<script>document.all.pTable.ResourceID = 'RESOURCE'</script>");
    
    }
    
    }
    }
    And i Have the error connection that i've mentionned :

    http://img411.imageshack.us/my.php?i...cscreenvl3.jpg

    According to me, the issue is there

    Code:
    Response.Write(@"<script>document.all.pTable.ConnectionString ='" + ConfigurationManager.ConnectionStrings["TimeTrackingDB"] + "'</script>");
    But I'm not able to see it. If someone see a BIG or a small mistake, please let me know.
    Last edited by fists; 06-05-07 at 04:44.

  7. #7
    Join Date
    May 2007
    Posts
    6
    So, i've several answer in other forum. It really seem an SQL issue.
    But nobody know how to fix it.
    Maybe someone knows here

    Code:
    Response.Write(@"<script>document.all.pTable.ConnectionString ='Provider=MSDASQL.1;Persist Security Info=True;Extended Properties=\'DSN=MSAccess Database;DBQ=C:\Program Files\MicrosoftOffice\OFFICE11\SAMPLES\Northwind.mdb;\';Initial Catalog=C:\ProgramFiles\Microsoft Office\OFFICE11\SAMPLES\Northwind'</script>");
    This is the code I ve find on Internet with a connection to access file.

    I want to adapt it with my Microsoft sqlServer 2000 and visual Studio

    Database Name : TimeTracking
    Pass : USER_TTT
    login : USER_TTT
    Provider : ??
    Data Source = PORT06139\DEV_2000;
    Initial Catalog=TimeTrackingDB
    Persist Security Info=True

    Does anybody can make the sql request according to the previous information?

    Thanks you very much in advance.

Posting Permissions

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