473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Async Webservice Result Object

Using the Following Code
Private WithEvents m_WS As WSSyfretsOrders.WSSyfretsOrders

Private Sub UtilityToolBar1_MapDrivePressed(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
UtilityToolBar1.MapDrivePressed
m_WS = New WSSyfretsOrders.WSSyfretsOrders
AddHandler m_WS.Get_OnprocessedCompleted, AddressOf
Get_OnprocessedCompleted
Start_WSCall()
End Sub
Private Sub Get_OnprocessedCompleted(ByVal Sender As Object, ByVal e As
SyfretsOrderWatch.WSSyfretsOrders.Get_OnprocessedC ompletedEventArgs)

Me.DataGridView1.DataSource = e.Result
Me.ToolStripLabel1.Text = Now.ToLongTimeString
End Sub

This works but I want to get to the Result as a datatable from the webservice.
I have looked at e the event argument but not found a way to get the
datatable out.

Any Advice Much appreciated.

Nov 16 '06 #1
3 1822
"Laird" <La***@discussions.microsoft.comwrote in message
news:35**********************************@microsof t.com...
Using the Following Code
Private WithEvents m_WS As WSSyfretsOrders.WSSyfretsOrders

Private Sub UtilityToolBar1_MapDrivePressed(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
UtilityToolBar1.MapDrivePressed
m_WS = New WSSyfretsOrders.WSSyfretsOrders
AddHandler m_WS.Get_OnprocessedCompleted, AddressOf
Get_OnprocessedCompleted
Start_WSCall()
End Sub
Private Sub Get_OnprocessedCompleted(ByVal Sender As Object, ByVal e As
SyfretsOrderWatch.WSSyfretsOrders.Get_OnprocessedC ompletedEventArgs)

Me.DataGridView1.DataSource = e.Result
Me.ToolStripLabel1.Text = Now.ToLongTimeString
End Sub

This works but I want to get to the Result as a datatable from the
webservice.
I have looked at e the event argument but not found a way to get the
datatable out.

Any Advice Much appreciated.
How can we know how to get you a DataTable when you don't provide us any
information on the web service?

John
Nov 17 '06 #2


"John Saunders" wrote:
"Laird" <La***@discussions.microsoft.comwrote in message
news:35**********************************@microsof t.com...
Using the Following Code
Private WithEvents m_WS As WSSyfretsOrders.WSSyfretsOrders

Private Sub UtilityToolBar1_MapDrivePressed(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
UtilityToolBar1.MapDrivePressed
m_WS = New WSSyfretsOrders.WSSyfretsOrders
AddHandler m_WS.Get_OnprocessedCompleted, AddressOf
Get_OnprocessedCompleted
Start_WSCall()
End Sub
Private Sub Get_OnprocessedCompleted(ByVal Sender As Object, ByVal e As
SyfretsOrderWatch.WSSyfretsOrders.Get_OnprocessedC ompletedEventArgs)

Me.DataGridView1.DataSource = e.Result
Me.ToolStripLabel1.Text = Now.ToLongTimeString
End Sub

This works but I want to get to the Result as a datatable from the
webservice.
I have looked at e the event argument but not found a way to get the
datatable out.

Any Advice Much appreciated.

How can we know how to get you a DataTable when you don't provide us any
information on the web service?

John
The Webmethod returns a DataTable as the Result.
I can bind the reply object to a datagrid or databound control but I want to
be able to access the DataTable that is being returned from the Webservice.

Thank you kindly.
Nov 17 '06 #3
"Laird" <La***@discussions.microsoft.comwrote in message
news:52**********************************@microsof t.com...
>

"John Saunders" wrote:
>How can we know how to get you a DataTable when you don't provide us any
information on the web service?

John

The Webmethod returns a DataTable as the Result.
I can bind the reply object to a datagrid or databound control but I want
to
be able to access the DataTable that is being returned from the
Webservice.
Two things:

1) You say you can bind the result to a DataGrid. What is the .NET type of
the result?
2) You should avoid platform-specific types in web services. The web
services infrastructure was designed with cross-platform scenarios in mind.
Even when the two platforms are the same, this design tends to bring
everything down to the least-common-denominator.

Instead of returning a DataTable, I suggest you return a collection of
what's known as a Data Transfer Object (DTO). This is not a business object,
but rather an object intended only to hold the "data" portion of a business
object. For instance, if you are using typed datasets and your rows have
columns a, b, and c:

private struct EmployeeDTO
{
public int a;
public string b;
public DateTime c;
}

[WebMethod]
public EmployeeDTO[] MyWebMethod()
{
_dataAdapter.Fill(_dataSet);
EmployeeDTO[] result = new EmploeeDTO[_dataSet.EmployeeTable.Count];

for (int i=0; i<_dataSet.EmployeeTable.Count; i++)
{
result[i] = new EmployeeDTO();
result[i].a = _dataSet.EmployeeTable[i].a;
result[i].b = _dataSet.EmployeeTable[i].b;
result[i].c = _dataSet.EmployeeTable[i].c;
}

return result;
}

John
Nov 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
by: jabailo | last post by:
I am looping through a text file, and with each row, I launch a web service, asynchronously. Before I move on to the next step in the process, I want to make sure that all the web services have...
1
by: Tom | last post by:
public class Client { public Server svr; public void callbackMethod(IAsyncResult asyncResult) { svr.EndAsyncMethod(result) } static void Main(string args)
10
by: Shawn Meyer | last post by:
Hello - I am trying to write a class that has an async BeginX and EndX, plus the regular X syncronous method. Delegates seemed like the way to go, however, I still am having problems getting...
5
by: Homa | last post by:
Hi all, Can anyone give me some links about how to do an async web service call from aspx and display a temperary page before the web service returns? Thanks, Homa Wong
0
by: Jens Weibler | last post by:
Hi, I'm trying to call a webservice asynchronous and works. But if I enter a wrong proxy webservice.Proxy = new WebProxy("b"); I won't get a callback with an async call like...
0
by: koredump | last post by:
Hi all, I have a windows app that makes some asyc calls to my webservice (WSE 3.0 with MTOM). exception gets thrown in the client win app. I know this exception is caused on the async...
0
by: Paul Hadfield | last post by:
Hi, From reading various articles on scalability issues, I understand that there is only a finite number of ASP.NET worker threads and any long running task within ASP.NET should be fired off on...
2
by: jojoba | last post by:
Hello to all! I have a fairly simple webservice running in asp.net ajax under c# (vs 2008). I built the service and it runs just dandy when i test it by itself in visual studio. However, to...
1
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... There are a few questions wrapped up in this, but the main one is that the WebService.MyMethodAsync() methods that are automatically generated in the client code by VS 2005 don't seem to...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.