This message was discovered on microsoft.public.dotnet.framework.aspnet.webservices.
| theanalyzer |
How do you return a dataset from a client app. I can program as label1.TEXT news feed to return a WebService but I can't figure out how to return a dataset. I declared the Namespace and Class but how do you return the ------------------------------------------------------------ Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim callback As System.AsyncCallback
Dim asyncState As Object
Dim Getheadlines As System.Data.DataSet
Dim myrow As DataSet
Dim Datagrid1 As DataSet
Dim mydataset As DataSet
Dim objService As New com.angrycoder.www.ContentFeed()
DataSet1 = objService.GetHeadlines()
End Sub
Reference file
'--------------------------------------------------------------------------- --- ' <autogenerated> ' This code was generated by a tool. ' Runtime Version: 1.0.3705.0 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </autogenerated> '--------------------------------------------------------------------------- ---
Option Strict Off Option Explicit On
Imports System Imports System.ComponentModel Imports System.Diagnostics Imports System.Web.Services
Imports System.Web.Services.Protocols Imports System.Xml.Serialization
' 'This source code was auto-generated by Microsoft.VSDesigner, Version 1.0.3705.0. ' Namespace com.angrycoder.www
'<remarks/> <System.Diagnostics.DebuggerStepThroughAttribute(), _ System.ComponentModel.DesignerCategoryAttribute("code"), _ System.Web.Services.WebServiceBindingAttribute(Name:="ContentFeedSoap", [Namespace]:="http://angryCoder.com/webservices/")> _ Public Class ContentFeed Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
'<remarks/> Public Sub New() MyBase.New Me.Url = "http://www.angrycoder.com/content_feed.asmx" End Sub
'<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://angryCode r.com/webservices/GetHeadlines", RequestNamespace:="http://angryCoder.com/webservices/", ResponseNamespace:="http://angryCoder.com/webservices/", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _ Public Function GetHeadlines() As <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> System.Data.DataSet Dim results() As Object = Me.Invoke("GetHeadlines", New Object(-1) {}) Return CType(results(0),System.Data.DataSet) End Function
'<remarks/> Public Function BeginGetHeadlines(ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult Return Me.BeginInvoke("GetHeadlines", New Object(-1) {}, callback, asyncState) End Function
'<remarks/> Public Function EndGetHeadlines(ByVal asyncResult As System.IAsyncResult) As System.Data.DataSet Dim results() As Object = Me.EndInvoke(asyncResult) Return CType(results(0),System.Data.DataSet) End Function
'<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://angryCode r.com/webservices/SearchArticles", RequestNamespace:="http://angryCoder.com/webservices/", ResponseNamespace:="http://angryCoder.com/webservices/", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _ Public Function SearchArticles(<System.Xml.Serialization.XmlElementAttribute(IsNullable:=tru e)> ByVal Keyword As String) As <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> System.Data.DataSet Dim results() As Object = Me.Invoke("SearchArticles", New Object() {Keyword}) Return CType(results(0),System.Data.DataSet) End Function
'<remarks/> Public Function BeginSearchArticles(ByVal Keyword As String, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult Return Me.BeginInvoke("SearchArticles", New Object() {Keyword}, callback, asyncState) End Function
'<remarks/> Public Function EndSearchArticles(ByVal asyncResult As System.IAsyncResult) As System.Data.DataSet Dim results() As Object = Me.EndInvoke(asyncResult) Return CType(results(0),System.Data.DataSet) End Function End Class End Namespace
|
|
| |
| |
| Christian Weyer |
What are you trying to do? Just get the DataSet from the Web Service? Is this your actual code?
Christian --------------------------------- .NET XML Web Services Repertory http://www.xmlwebservices.cc/ ---------------------------------
theanalyzer wrote:
[Original message clipped]
|
|
| |
| |
| theanalyzer |
I'm trying to write an app to consume the webservice to get the feed. It's part of the code... . yes.
"Christian Weyer" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... [Original message clipped]
|
|
| |
| |
| Christian Weyer |
Something like --- Dim oDS As DataSet Dim oWS As New com.angrycoder.www.ContentFeed() oDS = objService.GetHeadlines()
' use oDS for data binding in DataGrid ---
will do it and works fine here.
Christian --------------------------------- .NET XML Web Services Repertory http://www.xmlwebservices.cc/ ---------------------------------
theanalyzer wrote:
[Original message clipped]
|
|
| |
| |
| theanalyzer |
Hi Christian, Thanks for your help again? I'm getting an error here's my aspx below I made a Datagrid and bound oDS to databinding as you stated but I'm getting an error on line 14, the compiler doesn't like the datasource name. Not sure what to do next? Vinnie
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'oDS' is not declared.
Source Error:
..aspx ---------------------------------------------------------------------------- ---------------------------- 1. <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="xmltips.WebForm1"%> 2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3. <HTML> 4. <HEAD> 5. <title>WebForm1</title> 6. <meta content="Microsoft Visual Studio.NET 7.0" name=GENERATOR> 7. <meta content="Visual Basic 7.0" name=CODE_LANGUAGE> 8. <meta content=JavaScript name=vs_defaultClientScript> 9. <meta content=http://schemas.microsoft.com/intellisense/ie5 name=vs_targetSchema> 10. </HEAD> 11. <body MS_POSITIONING="GridLayout"> 12. <FORM id=Form1 method=post runat="server"> 13. <asp:DataGrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 36px; POSITION: absolute; TOP: 48px" runat="server" Height="268px" 14. Width="502px" DataSource="<%# oDS %>"></asp:DataGrid></FORM></FORM> 15. 16. </body> 17.</HTML>
"Christian Weyer" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... [Original message clipped]
|
|
| |
|
|
|
|
|
|
|
|