<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Amir Ali's Open Blog</title>
	<atom:link href="http://amiralijiwani.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://amiralijiwani.wordpress.com</link>
	<description>A Programming Based Blog .... !</description>
	<lastBuildDate>Fri, 02 Jan 2009 15:42:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='amiralijiwani.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Amir Ali's Open Blog</title>
		<link>http://amiralijiwani.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://amiralijiwani.wordpress.com/osd.xml" title="Amir Ali&#039;s Open Blog" />
	<atom:link rel='hub' href='http://amiralijiwani.wordpress.com/?pushpress=hub'/>
		<item>
		<title>MySql with C# (a simple approach)</title>
		<link>http://amiralijiwani.wordpress.com/2009/01/02/mysql-with-c-a-simple-approach/</link>
		<comments>http://amiralijiwani.wordpress.com/2009/01/02/mysql-with-c-a-simple-approach/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 15:24:03 +0000</pubDate>
		<dc:creator>amiralijiwani</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://amiralijiwani.wordpress.com/?p=3</guid>
		<description><![CDATA[most of the people think that is it possible to connect C# with MySql, and keep on thinking that how can i do it ???? Even after having the MySql driver for C# it is a little difficult for a simple C# user to connect it to MySql. Even when i have downloaded the driver [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amiralijiwani.wordpress.com&amp;blog=5301373&amp;post=3&amp;subd=amiralijiwani&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>most of the people think that is it possible to connect C# with MySql, and keep on thinking that how can i do it ???? Even after having the MySql driver for C# it is a little difficult for a simple C# user to connect it to MySql. Even when i have downloaded the driver myself it was a difficult task for me to go for it. So i made lots of sample project to basically connect to MySql through C#, After having these all experience, i designed a simple class just like SqlClient and basic functions to get connected to MySql on any host and get work done easily <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It is very easy to use this class even u will see that the functions are self explanatory <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>U just simple have to know to which host are u connecting, port number and the schema ur selecting and start executing queries the way u want <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  isn&#8217;t that simple <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  i will also improve this class later when i will have a response that people are happy with this class and yes this class is open source so u may change the way u want it to <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  or just use its default <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  You may check it ur self, some code is shown below the rest i guess u can handle <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Explanation :</p>
<p>for this class to run properly u need some pre-requisites :</p>
<p>Mysql, A database, Mysql Connection Driver For .Net (Easily available on <cite><a title="MySql's Official Website" href="http://www.mysql.com" target="_blank">www.<strong>mysql</strong>.com</a>)</cite></p>
<p>after all the pre-requisites you need a project, on that project u need to add the reference MySQL.Data from add reference in ur project and now u may even add reference for MySQL.Web so as u wish but MySQL.Data is necessary for this class and then u need to write on top of ur project where the using block is another pair of lines, i.e.</p>
<p>using MySQLWrap;    // as this is the namespace for my wrapper class<br />
then u need a new DatabaseConnection Object that u can do by</p>
<p>DatabaseConnection anObj = new DatabaseConnection(&#8220;localhost&#8221;, &#8220;root&#8221;, &#8220;&#8221;, &#8220;mysql&#8221;);<br />
in the above line the class constructor is called where localhost is the hostname for the server, root is the username to have access, string.Empty is representing the password for the server and mysql is the schema to select for this connection <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>now a test query should be run <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>but before that lets connect first and check if the connection is made correctly or not<br />
if (anObj.connect() == true)<br />
{<br />
//do what u want to do from database.<br />
}<br />
else<br />
{<br />
// there is some problem with the database.<br />
}</p>
<p>now for the query part<br />
if  (anObj.executeQuery(&#8220;SELECT * FROM table&#8221;) == true)<br />
{<br />
// manipulate the data by read() and getRow() functions like<br />
while (anObj.read() == true)<br />
{<br />
Hashtable aRow = anObj.getRow();<br />
aRow["col1"]; // this will give u the desired value in the row for column named col1<br />
}<br />
}<br />
else<br />
{<br />
// there may be some error with ur query :S<br />
}</p>
<p>mysqlEscapeString(anyVariableOfTypeString);<br />
the above function is also provided with the class to get rid of SQL injections in the database <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>i think this overview is ok for the startup rest u people can comment and i will improve the class by ur response <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>u can download the file from here : <a title="Database Connection.doc" href="http://amiralijiwani.wordpress.com/2009/01/02/mysql-with-c-a-simple-approach/databaseconnection/" target="_blank">Database Connection.doc</a></p>
<p>waiting for everyones response and thankyou for ur time <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amiralijiwani.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amiralijiwani.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amiralijiwani.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amiralijiwani.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/amiralijiwani.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/amiralijiwani.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/amiralijiwani.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/amiralijiwani.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amiralijiwani.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amiralijiwani.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amiralijiwani.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amiralijiwani.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amiralijiwani.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amiralijiwani.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amiralijiwani.wordpress.com&amp;blog=5301373&amp;post=3&amp;subd=amiralijiwani&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amiralijiwani.wordpress.com/2009/01/02/mysql-with-c-a-simple-approach/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fba359a0a4986468cc7228e659b460a6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amiralijiwani</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://amiralijiwani.wordpress.com/2008/10/26/hello-world/</link>
		<comments>http://amiralijiwani.wordpress.com/2008/10/26/hello-world/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 06:34:51 +0000</pubDate>
		<dc:creator>amiralijiwani</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amiralijiwani.wordpress.com&amp;blog=5301373&amp;post=1&amp;subd=amiralijiwani&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amiralijiwani.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amiralijiwani.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amiralijiwani.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amiralijiwani.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/amiralijiwani.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/amiralijiwani.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/amiralijiwani.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/amiralijiwani.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amiralijiwani.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amiralijiwani.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amiralijiwani.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amiralijiwani.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amiralijiwani.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amiralijiwani.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amiralijiwani.wordpress.com&amp;blog=5301373&amp;post=1&amp;subd=amiralijiwani&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amiralijiwani.wordpress.com/2008/10/26/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fba359a0a4986468cc7228e659b460a6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amiralijiwani</media:title>
		</media:content>
	</item>
	</channel>
</rss>
