Bridging the Gap: Talking to MySQL From VB.NET Through PHP and XML - What's Said and Done in the End
(Page 4 of 4 )
Here is what our WebBridge object will see as a response:
<?xml version=”1.0” encoding=”UTF-8”
<Messages>
<Message>
<MsgID>1</MsgID>
<From>Test Dummy</From>
<Email>testdummy@td.com</Email>
<MsgDate>1/14/2004</MsgDate>
<MsgTime>1073437277</MsgTime>
</Message>
</Messages>
A clean and valid xml string containing all of your requested data that can be used to easily fill a DataSet within VB.NET. Sweet and (kind of) simple. Now run your project, click on either the “Read New” button or “Read Old” button to view the data from the database.
Your datagrid will show you something like this:

Now you can pat yourself on the back for peacefully bringing together 3 distinct technologies into one harmonic package.
Conclusion
If you need more information about any of the discussed technologies (VB.NET, PHP, MySQL, XML) be sure to visit these resources out on the web:
VB.NET - http://msdn.microsoft.com/vbasic
PHP - http://www.php.net
MySQL - http://www.mysql.com
XML - http://www.xml.com
So, if you are ever caught with an overly secure MySQL server environment and need to pull some data remotely, you can do it will a little bit of .NET magic.
This is meant as an example, and not as a full blown, secure method for database communications. This is also a good way to become familiar with some VB.NET techniques and to play around with various other technologies in a single project. I know I have learned quite a bit from trudging through this exercise myself and hopefully this will help others out there looking to do the same, while also catching the attention of Developer Shed, who will may just deem this worthy of display. [And in fact, we have! -Editor]
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |