Tuesday, November 29, 2005 6:02 AM
Is there a client side approach of sending and receiving data from a sql database without a web service or a server component (servicedcomponent and server app)? How can you simulate a network connection over the internet that could send and receive data from and to database?
How can you create a class that would do the same task as a network connection using internet communication as medium? Please point me to topics and documents about this matter.
Sunday, March 12, 2006 1:02 AM
SQLServer provides this feature.
I move this post.
Monday, March 13, 2006 5:58 PM
In .NET you would use the HttpWebRequest class, here is a simple bit of sample code to send a SOAP packet.
private void soapRequest()
Uri soapUri = new Uri("http://" + soapServer + "/clear_integrated");
string soapRequest =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"select * from authors" +
System.Text.UTF8Encoding utfEncoder = new UTF8Encoding();
byte  requestBytes = utfEncoder.GetBytes(soapRequest);
// Do the work.
for(int i=1; i<=loopCount; i++)
HttpWebRequest webRequest = (System.Net.HttpWebRequest)WebRequest.Create(soapUri);
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Timeout = timeout;
webRequest.KeepAlive = true;
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
webRequest.ContentLength = requestBytes.Length;
Stream requestStream = webRequest.GetRequestStream();
requestStream.Write(requestBytes, 0, requestBytes.Length);
WebResponse webResponse = webRequest.GetResponse();
StreamReader responseStream =
new System.IO.StreamReader(webResponse.GetResponseStream(), Encoding.UTF8);
string stringResponse = responseStream.ReadToEnd();
if (1445 != stringResponse.Length) failCount++;
catch (Exception ex)
Tuesday, March 14, 2006 7:58 AM
This topic is quite old. Thanks for the reply, at that time I post this topic, I am working on windows application on a tablet pc that needs internet connection and remote access to a remote MySQL database. This code of yours is for asp.net and how exactly would the data be transmitted? What protocol or utility would handle the actual sending of data, in my work then we uses VPN to establish remote database connection and ras dialup to establish internet connection. Thanks for the code, it might proved useful next time.