Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My First Web Service

Status
Not open for further replies.

G00GLER

Instructor
May 17, 2005
57
0
0
US
NEED TO RETURN a dataset:

this is how I would do it going directly from a windows form to sql server:
Code:
private void RetrieveData()
{
//MYSQLSERVERCONNECTION
DBConnStr = "Data Source=blah, blah, blah";

SqlConnection SQLCn = new SqlConnection(DBConnStr);

//MY DATAADAPTER
SqlDataAdapter SQLDA = new SqlDataAdapter("SELECT  *  FROM dbo.v4Ryan", SQLCn);

//FILL DATASET
SQLDA.Fill(myDataSet, "tblXMLExport");

//EMPTY DATASET
SQLDA.Dispose();

//DEFINE SOURCE
dataGridView2.DataSource = myDataSet.Tables["tblXMLExport"];

//STORE USER XML FILE ON CLIENT MACHINE to edit records when not online.

myDataSet.WriteXml("c:\\t.xml");
myDataSet.WriteXmlSchema("c:\\t.xsd");
}
[CODE]

So guess in the web service I want to return a string, from that create the XML file on client's machine and then bind windows form to that local XML FILE
 
Datasets are serializable to you can write a function within the web service and then return the entire dataset to where ever you called it from.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top