Re: DISP_E_TYPEMISMATCH with OWC11



Line 56, you need to pass the two parameters to the addnew function of the
datasource control.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

<srphayre@xxxxxxxxxxxxx> wrote in message
news:sI%Rf.8801$z82.1093@xxxxxxxxxxxxx
Alvin - thanks for replying. The SQL string works without a hitch. Do
you think its related to what data type OWC is expecting from the SQL
output, but its not getting that data type?

Thanks,
Steve

"Alvin Bruney - ASP.NET MVP" <www.lulu.com/owc> wrote in message
news:eZEzIlESGHA.4600@xxxxxxxxxxxxxxxxxxxxxxx
this is a sql error not owc

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
-------------------------------------------------------



<srphayre@xxxxxxxxxxxxx> wrote in message
news:OnsRf.8650$z82.1284@xxxxxxxxxxxxx
Hi,
Does anyone have any idea what I am doing wrong here. I have a SQL
query
that pulls some data from a database and I want to display it as a
graph.
Here is the code snippet:

Dim objChartspace, objChart, c, objConn, objRS, axis, sql
objChartspace = Server.CreateObject("owc11.Chartspace")
objConn = Server.CreateObject("OWC11.DataSourceControl")
objConn.ConnectionString = Application("AMS")
objChart = objChartspace.Charts.Add
c = objChartspace.Constants
objChart.Type = c.chChartTypeLine
objChart.HasLegend = True
sql = "Select Workgroup, day(lastModifiedOn) as entryMonth,
count(*)
as _
entryTotals from vw_UnBilledEntries group by workgroup,
day(lastModifiedOn)"
objConn.RecordsetDefs.AddNew(sql)
objChartspace.DataSource = objRS
objChart.SetData(c.chDimSeriesNames, 0, "Workgroup")
objChart.SetData(c.chDimCategories, 0, "entryMonth")
objChart.SetData(c.chDimValues, 0, "entryTotals")
For Each axis In objChart.Axes
axis.HasTitle = True
If axis.Type = c.chCategoryAxis Then
axis.Title.Caption = "entryMonth"
Else
axis.Title.Caption = "entryTotals"
End If
Next
objChartspace.ExportPicture(Server.MapPath("/images/amschart"),
"gif", 600, 350)
Response.Write("<img src=""\images\amschart.gif"">")

However I get this error:

Type mismatch. (Exception from HRESULT: 0x80020005
(DISP_E_TYPEMISMATCH))
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Type
mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

Source Error:

Line 55: sql = "Select Workgroup, day(lastModifiedOn) as
entryMonth,
count(*) as entryTotals from vw_UnBilledEntries group by workgroup,
day(lastModifiedOn)"
Line 56: objConn.RecordsetDefs.AddNew(sql)
Line 57: objChartspace.DataSource = objRS
Line 58: objChart.SetData(c.chDimSeriesNames, 0, "Workgroup")
Line 59: objChart.SetData(c.chDimCategories, 0, "entryMonth")


Anyone have any words of wisdom?

Thanks,
Steve








.



Relevant Pages

  • DISP_E_TYPEMISMATCH with OWC11
    ... Dim objChartspace, objChart, c, objConn, objRS, axis, sql ... entryTotals from vw_UnBilledEntries group by workgroup, ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.office.developer.web.components)
  • Re: DISP_E_TYPEMISMATCH with OWC11
    ... The Microsoft Office Web Components Black Book with .NET ... I have a SQL query ... Dim objChartspace, objChart, c, objConn, objRS, axis, sql ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.office.developer.web.components)
  • Re: DISP_E_TYPEMISMATCH with OWC11
    ... The SQL string works without a hitch. ... think its related to what data type OWC is expecting from the SQL output, ... Dim objChartspace, objChart, c, objConn, objRS, axis, sql ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.office.developer.web.components)
  • Re: SQL Express - Identity specification property - how to change
    ... FOO_ID int identity, ... Tony Rogerson, SQL Server MVP ... They are making unfortunately frequent use of the IDENTITY column in conjunction with Primary Key. ... IDENTITY has none of the properties of a data type because it is not a data type at all. ...
    (comp.databases.ms-sqlserver)
  • RE: Express refuses to install
    ... Loaded DLL:C:\Program Files\Microsoft SQL Server\90\Setup ... Action "LaunchPatchedBootstrapAction" will be skipped due to the following ... Action "InvokeSqlSetupDllAction" threw an exception during execution. ... Aborting queue processing as nested installer has completed ...
    (microsoft.public.sqlserver.setup)

Quantcast