public void GetDelivery(DateTime dtBegin, DateTime dtEnd) { try { var objManifest = new WSManifest.SwiftExpressWSManifest(); var pResult = ""; var ds = objManifest.GetDelivery(Session["connectionString"].ToString(), dtBegin, dtEnd, ref pResult); if (pResult == "") { ASPxGridView1.DataSource = ds; ASPxGridView1.DataBind(); Session["DATA_DELIVERY"] = ds; } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } objManifest.Dispose(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }