Re: DISP_E_TYPEMISMATCH with OWC11
- From: "Alvin Bruney" <vapordan@xxxxxxxxxxx>
- Date: Fri, 17 Mar 2006 06:42:44 -0500
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,count(*)
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,
as _entryMonth,
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
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
.
- References:
- DISP_E_TYPEMISMATCH with OWC11
- From: srphayre
- Re: DISP_E_TYPEMISMATCH with OWC11
- From: Alvin Bruney - ASP.NET MVP
- Re: DISP_E_TYPEMISMATCH with OWC11
- From: srphayre
- DISP_E_TYPEMISMATCH with OWC11
- Prev by Date: How to merge cells?
- Next by Date: Re: Non-Standard Number Formats
- Previous by thread: Re: DISP_E_TYPEMISMATCH with OWC11
- Next by thread: SeriesCollection order changing for no reason
- Index(es):
Relevant Pages
|