Ask a Question related to ASP.NET Web Services, Design and Development.
-
Poppy #1
return xml
The following function is used in my webservice which
returns a dataset.
I now need to return the dataset as xml and have no idea
how to do it.
Can anyone help ?
Thanks in Advance
Code:Private Function GetDataSetXML(ByVal strSQL As String) As dataset '1. Create a connection Dim connString As String connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:\blobdata\data.mdb" & ";" Dim myConnection As New OleDbConnection(connString) '2. Create the command object, passing in the SQL string Dim myCommand As New OleDbCommand(strSQL, myConnection) myConnection.Open() '3. Create the DataAdapter Dim myDataAdapter As New OleDbDataAdapter() myDataAdapter.SelectCommand = myCommand '4. Populate the DataSet and close the connection Dim myDataSet As New DataSet() myDataAdapter.Fill(myDataSet) myConnection.Close() 'Return the DataSet Return myDataset End Function
Poppy Guest
-
Return me
:confused; I need the html for Dreamweaver 8 that will return a person back to a previous page. They could be coming from any number of previous... -
return SQL ID
one way (I believe to be the best way) is to use a stored procedure and set an output variable to the new SQL ID. a second way is to use a... -
goToNetPage, return or not return
hi, I have read in the director's help the netDone() command indicates whether a background loading operation (such as getNetText,... -
How to return my own XML?
When I create a web service, and create a web method that returns a string, the output is always framed within a tag that looks like: <string... -
Return Key
This may sound like an odd question, but does anyone have a "return" key from a Wallstreet powerbook that they don't need? All i need is the key,... -
Jan Tielens #2
Re: return xml
Every response of a webservice is in XML...
Can you be a little more specific what your requirements for that xml are?
--
Greetz,
Jan
________________________
Read my weblog: [url]http://weblogs.asp.net/jan[/url]
"Poppy" <paul.diamond@NOSPAMthemedialounge.com> schreef in bericht
news:uBYht9RKEHA.1340@TK2MSFTNGP12.phx.gbl...> The following function is used in my webservice which
> returns a dataset.
> I now need to return the dataset as xml and have no idea
> how to do it.
> Can anyone help ?
> Thanks in Advance
>
>>Code:> Private Function GetDataSetXML(ByVal strSQL As String) As > dataset > '1. Create a connection > Dim connString As String > connString > = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" > & "C:\blobdata\data.mdb" & ";" > Dim myConnection As New OleDbConnection(connString) > '2. Create the command object, passing in the SQL > string > Dim myCommand As New OleDbCommand(strSQL, > myConnection) > myConnection.Open() > '3. Create the DataAdapter > Dim myDataAdapter As New OleDbDataAdapter() > myDataAdapter.SelectCommand = myCommand > '4. Populate the DataSet and close the connection > Dim myDataSet As New DataSet() > myDataAdapter.Fill(myDataSet) > myConnection.Close() > 'Return the DataSet > Return myDataset > End Function >
>
Jan Tielens Guest
-
Scott M. #3
Re: return xml
Have you looked at the various methods of a DataSet that express its
contents as XML (writeXML, getXML)?
"Poppy" <paul.diamond@NOSPAMthemedialounge.com> wrote in message
news:uBYht9RKEHA.1340@TK2MSFTNGP12.phx.gbl...> The following function is used in my webservice which
> returns a dataset.
> I now need to return the dataset as xml and have no idea
> how to do it.
> Can anyone help ?
> Thanks in Advance
>
>>Code:> Private Function GetDataSetXML(ByVal strSQL As String) As > dataset > '1. Create a connection > Dim connString As String > connString > = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" > & "C:\blobdata\data.mdb" & ";" > Dim myConnection As New OleDbConnection(connString) > '2. Create the command object, passing in the SQL > string > Dim myCommand As New OleDbCommand(strSQL, > myConnection) > myConnection.Open() > '3. Create the DataAdapter > Dim myDataAdapter As New OleDbDataAdapter() > myDataAdapter.SelectCommand = myCommand > '4. Populate the DataSet and close the connection > Dim myDataSet As New DataSet() > myDataAdapter.Fill(myDataSet) > myConnection.Close() > 'Return the DataSet > Return myDataset > End Function >
>
Scott M. Guest
-
Dino Chiesa [Microsoft] #4
Re: return xml
maybe you mean an untyped XML string?
Private Function GetDatasetAsXmlString(...) as String
return myDataSet.getXML()
End Function
"Scott M." <s-mar@BADSPAMsnet.net> wrote in message
news:eRGJaZVKEHA.2776@TK2MSFTNGP12.phx.gbl...> Have you looked at the various methods of a DataSet that express its
> contents as XML (writeXML, getXML)?
>
>
> "Poppy" <paul.diamond@NOSPAMthemedialounge.com> wrote in message
> news:uBYht9RKEHA.1340@TK2MSFTNGP12.phx.gbl...>> > The following function is used in my webservice which
> > returns a dataset.
> > I now need to return the dataset as xml and have no idea
> > how to do it.
> > Can anyone help ?
> > Thanks in Advance
> >
> >> >Code:> > Private Function GetDataSetXML(ByVal strSQL As String) As > > dataset > > '1. Create a connection > > Dim connString As String > > connString > > = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" > > & "C:\blobdata\data.mdb" & ";" > > Dim myConnection As New OleDbConnection(connString) > > '2. Create the command object, passing in the SQL > > string > > Dim myCommand As New OleDbCommand(strSQL, > > myConnection) > > myConnection.Open() > > '3. Create the DataAdapter > > Dim myDataAdapter As New OleDbDataAdapter() > > myDataAdapter.SelectCommand = myCommand > > '4. Populate the DataSet and close the connection > > Dim myDataSet As New DataSet() > > myDataAdapter.Fill(myDataSet) > > myConnection.Close() > > 'Return the DataSet > > Return myDataset > > End Function > >
> >
>
Dino Chiesa [Microsoft] Guest



Reply With Quote

