Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Joao Silva   on Oct 10 In Asp.net Category.

  
Question Answered By: Luz Hayes   on Oct 10

If you need to return data in some nice well formed xml and withouth all
the stuff added by the DataSet you should go with a struct. Now if the
target of your web  service will be the embedded control, go with the
dataset. You would be able to get the dataset from the ws and bind it to
whatever you want.
If you want to return only one data return a "string". If you want to
return one row of data with different columns go with a struct.

I will write it in c#, but you could easily convert it
[WebMethod()]
public MyData GetData()
{
// open conn
// get a dataset
return ds;
// alternatively you can fill the struct and return the struct
// the struct will be serialized as XML in this way
// <myRow>
// <name>filled name</name>
// <address>the address</address>
// <age>35</age>
// </myRow>
}

public struct myRow
{
public string name;
public string address;
public int age;
}

Second one...
Regards the embedded control question, I've warn you about the problems
you'll have with this.
Check this pdf from Chris Sells (the guru on Smart Client). It is
simple.
http://www.sellsbrothers.com/tools/winformsweb.pdf

Also if you have time read  this msdn article
msdn.microsoft.com/.../default.a
spx

Both of articles have examples about getting a webserice running from a
smart client.

Did you go to Microsoft .NET Framework Configuration tool in Control
Panel\Administrative Tools
Go to Runtime Security Policy\Code Groups\Machine\All_Code
Right-Click and select New, you can create a code group using the URL
membership condition, using your http://... url and then use the
existing FullTrust permission set.

Share: 

 

This Question has 21 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Java Applet Or get search suggestion and latest updates.


Tagged: