Stored Procedures in Infopath

S

SDecou

I am receiving an error when I run the following code in Visual studio.NET

Dim MySysID As Integer
Dim myADOAdapter As ADOAdapterObject = thisXDocument.DataAdapters.Item(5)

MySysID =
thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:OvertimeLog/@SysID").text

myADOAdapter.Command = "execute dbo.sp_Overtime_Return" + MySysID
myADOAdapter.Query()
 
B

Ben Walters

The only thing I can see that may be causing a problem in this code is that
you need a space between your stored proc name and your variable
myADOAdapter.Command = "execute dbo.sp_Overtime_Return " + MySysID


hope this helps
Cheers
Ben
 
S

SDecou

I added the space and I am still receiving the following error:

System.InvalidCastException
Cast from string "execute dbo.sp_Overtime_Return " to type 'Double' is not
valid.
at Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String
Value, NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String
Value)
at CLOTLog.CLOTLog.Retrieve_Data_OnClick(DocActionEvent e) in
C:\Infopath\CLOTLog\FormCode.vb:line 715
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top