Getting returning XML string from dhtmlxGridConnector

When returning dhtmlxGridConnector from it produces XML, how do I obtain that XML string prior to returning, so I might use it for other purposes?

[WebService(Namespace = “http://tempuri.org/”)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class ExportConnector : dhtmlxRequestHandler
{
private string _msConnStr; // Connection string to database

public override IdhtmlxConnector CreateConnector(HttpContext context)
{
var connector = new dhtmlxGridConnector(
"SELECT * FROM " + sTable,
“ID”,
dhtmlxDatabaseAdapterType.SqlServer2005,
msConnStr
);
return connector;
}
}

Hello,
there is no simple way to retrieve output string from a connector, it is designed to write it directly to the HttpResponce. However, you can create new instance of HttpResponse and tell connector to use it. Then you’ll be able to read request’s stream. Code might be the following:[code]public virtual void ProcessRequest(HttpContext context)//generic handler
{
var connector = new dhtmlxGridConnector(…); //create connector

connector.ProcessRequest(context.Request.QueryString, context.Request.Form);

var str = new System.IO.MemoryStream();//remporary stream and responce object to render output to
var resp = new HttpResponse(new System.IO.StreamWriter(str));
resp.HeaderEncoding = new System.Text.UTF8Encoding();

connector.RenderResponse(resp);//render connector's output to responce object

str.Position = 0;
var reader = new System.IO.StreamReader(str);
var xml = reader.ReadToEnd();//read xml string from the stream[/code]