コード例 #1
0
		/////////////////////////////////////////////////////////////////////////////
		public void GetDataSet(string query, EventHandler requestCompleteHandler)
		{
			m_RequestCompleteHandler = requestCompleteHandler;

			try
			{
#if EXPLICIT
				// It is not really necessary to pass a binding and an endpoint address when creating the service proxy,
				// however, we want to dynamically choose either localhost or the web server
				Uri webServiceUri = new Uri("http://localhost:51698/DBService.svc");
//j				Uri webServiceUri = new Uri("http://facetofacesoftware.com/FutureMoneyWebServices/DBService.svc");
//j				Uri webServiceUri = new Uri("http://www.dreamnit.com/FutureMoneyWebServices/DBService.svc");
				DBServiceClient px = new DBServiceClient(new BasicHttpBinding(), new EndpointAddress(webServiceUri));
#else
				DBServiceClient px = new DBServiceClient();
#endif
				px.GetOleDbDataSetCompleted += GetDataSetCompleted;
				px.GetOleDbDataSetAsync(query);
			}
			catch (Exception e)
			{
				if (m_RequestCompleteHandler != null)
					m_RequestCompleteHandler.Invoke(e.Message, null);
			}
		}