P
Patrick.O.Ige
I want to get a DataSet returned from my SqlXml webservice using a
storedproc.
The storedproc returns a simple "Select * from Customers"
The method below connects to the service and its suppose to return a
Dataset.
When i first ran it i got an error :- "Cannot cast Type Dataset to Object"
So i found a solution using this
:http://support.microsoft.com/default.aspx?scid=kb;EN-US;815131
which apparently its a bug.
So i looked into my webservice "reference.cs" file and changed my spCustomer
method to
public System.Data.DataSet spCustomers() {
object[] results = this.Invoke("spCustomers", new object[0]);
return ((System.Data.DataSet)(results[0]));
and the error disspeared.
public void getXmlWebserivceData()
{
TestWebService.devpc1.soap mysoapservice = new devpc1.soap();
mysoapservice.Credentials =
System.Net.CredentialCache.DefaultCredentials;
ds = (DataSet)mysoapservice.spCustomers();
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
}
The thing is if i configure SqlXml to return a single Dataset using
storedproc. it works fine but i have another template that executes a
storedproc but returns XML
I keep getting error
"For non-array types, you may use the following attributes: XmlAttribute,
XmlText, XmlElement, or XmlAnyElement. "
Any ideas?
storedproc.
The storedproc returns a simple "Select * from Customers"
The method below connects to the service and its suppose to return a
Dataset.
When i first ran it i got an error :- "Cannot cast Type Dataset to Object"
So i found a solution using this
:http://support.microsoft.com/default.aspx?scid=kb;EN-US;815131
which apparently its a bug.
So i looked into my webservice "reference.cs" file and changed my spCustomer
method to
public System.Data.DataSet spCustomers() {
object[] results = this.Invoke("spCustomers", new object[0]);
return ((System.Data.DataSet)(results[0]));
and the error disspeared.
public void getXmlWebserivceData()
{
TestWebService.devpc1.soap mysoapservice = new devpc1.soap();
mysoapservice.Credentials =
System.Net.CredentialCache.DefaultCredentials;
ds = (DataSet)mysoapservice.spCustomers();
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
}
The thing is if i configure SqlXml to return a single Dataset using
storedproc. it works fine but i have another template that executes a
storedproc but returns XML
I keep getting error
"For non-array types, you may use the following attributes: XmlAttribute,
XmlText, XmlElement, or XmlAnyElement. "
Any ideas?