Yes you can use a DataSet object fill the same object 2 times with different data and pass it along. Once on the client side you receive the DataSet then you can use standard ADO.NET to extract records from the dataset and add it to your local database
I am attaching sample web service code below
twotables.asmx
<%@ WebService language="C#" class="TwoTables" %>
using System;
using System.Web.Services;
using System.Xml.Serialization;
using System.Data.SqlClient ;
public class TwoTables {
[WebMethod]
public System.Data.DataSet GetTwoTables() {
string connectionString = "server=\'(local)\'; trusted_connection=true; database=\'Northwind\'";
System.Data.IDbConnection dbConnection = new System.Data.SqlClient.SqlConnection(connectionString);
string queryString = @"SELECT TOP 10 * from [Orders]";
System.Data.IDbCommand dbCommand = new System.Data.SqlClient.SqlCommand();
dbCommand.CommandText = queryString;
dbCommand.Connection = dbConnection;
System.Data.IDbDataAdapter dataAdapter = new System.Data.SqlClient.SqlDataAdapter();
dataAdapter.SelectCommand = dbCommand;
System.Data.DataSet dataSet = new System.Data.DataSet();
dataAdapter.Fill(dataSet);
dbCommand.CommandText = @"SELECT TOP 10 * from [Order Details]";
dataAdapter.Fill(dataSet);
return dataSet;
}
}
--
Regards,
Saurabh Nandu
AksTech Solutions, reflecting your needs...
[
www.AksTech.com ]
[
www.MasterCSharp.com ]