I have a question about sending information to a Web Service. From code I have a DataTable that is filled with a query to Database, which I want to send to the Web Service in xml format.
How to send a DataTable to a webservice in XML format?
DataTable Code:
public void consultaUSistema(DataGridView datagridView)
{
string sXMLparam = "";
DataSet dtsCatalogo = new DataSet();
sXMLparam = "<root><accion>C</accion>";
sXMLparam += "</root>";
ReaderAndWriter.ConnectionString = Constants.connectionString1;
try
{
dtsCatalogo = ReaderAndWriter.OneParameterStoreProcCaller("SP", sXMLparam);
datagridView.DataSource = dtsCatalogo.Tables[0];
if (dtsCatalogo.Tables[0] != null)
{
DataTable dt = new DataTable();
dt = dtsCatalogo.Tables[0]; //aquí se llena el dataTable
}
}
catch (Exception objException)
{
}
}