Hi Terry,
You will need to return a "dataset" for InfoPath to consume this data. Here
are some links that may be of benefit:
Lab 9: ADO.NET DataSets in InfoPath 2003
http://msdn.microsoft.com/office/understanding/infopath/training/default.asp
x?pull=/library/en-us/odc_ip2003_tr/html/odc_inf_lab_09.asp
826994: How to dynamically populate a drop-down list by calling a Web
service in InfoPath 2003
http://support.microsoft.com/default.aspx?scid=kb;EN-US;826994
Here is a VB.NET sample web method for returning the Company names from the
Customers table in the Northwind sample database:
<WebMethod()> _
Public Function ListCustomers() As DataSet
Dim da As New SqlDataAdapter("SELECT CustomerID, CompanyName FROM
Customers", con)
Dim dsCustomersOnly As New DataSet
da.Fill(dsCustomersOnly, "Customers")
Return dsCustomersOnly
End Function
I hope this helps!
Best Regards,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights
Support - 01 Aug 2005 15:42 GMT
thanks scott:
so this should work...?
<WebMethod(Description:="This function provides you will all the news
release years we have as a dataset")> Public Function NewsGetdatesDataset()
As DataSet
Dim MyInternals As New Internals
Return MyInternals.GetDatasetdates()
End Function
Public Function GetDatasetdates() As DataSet
Dim cn As New SqlConnection(MyConnectionString)
cn.Open()
Dim cmd As New SqlCommand("Sproc_NEWSRELEASES", cn)
cmd.CommandType = CommandType.StoredProcedure
Dim adapt As New SqlDataAdapter(cmd)
adapt.Fill(GetDatasetdates, "year")
cn.Close()
cn = Nothing
cmd = Nothing
MyConnectionString = Nothing
Return GetDatasetdates()
End Function
> Hi Terry,
>
[quoted text clipped - 32 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Scott L. Heim [MSFT] - 02 Aug 2005 20:13 GMT
Hi Terry,
I have not specifically tested in the manner you describe but it seems as
though it should work.
Best Regards,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights