Group:  Other Microsoft Office Products ยป microsoft.public.infopath
Thread: Stored Procedures in Infopath

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Stored Procedures in Infopath
SDecou 20.07.2006 20:22:02
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/[ at ]SysID").text

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

RE: Stored Procedures in Infopath
Ben Walters 20.07.2006 23:40:02
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

"SDecou" wrote:

[Quoted Text]
> 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/[ at ]SysID").text
>
> myADOAdapter.Command = "execute dbo.sp_Overtime_Return" + MySysID
> myADOAdapter.Query()
>
RE: Stored Procedures in Infopath
SDecou 21.07.2006 18:49:02
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?

"Ben Walters" wrote:

[Quoted Text]
> 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
>
> "SDecou" wrote:
>
> > 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/[ at ]SysID").text
> >
> > myADOAdapter.Command = "execute dbo.sp_Overtime_Return" + MySysID
> > myADOAdapter.Query()
> >

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net