<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-18580676</id><updated>2011-04-21T21:15:21.710+01:00</updated><title type='text'>Code Frenzy</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codefrenzy.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://codefrenzy.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Wayne Phipps</name><uri>http://www.blogger.com/profile/03399910634594530719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/blogger/4886/1812/1600/Me.0.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-18580676.post-9163513458575143345</id><published>2007-02-17T16:16:00.000Z</published><updated>2008-12-10T09:34:35.838Z</updated><title type='text'>How to Serialise Image</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;I was reading in the CodeProject C# forum when a question gave me the idea for a simple article.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The poster wanted to read an image into a byte array and had posted some sample code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;This is a concept that some time ago, I created several test projects when I wanted test the posibility of storing objects in a database.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I looked upon the image as being just another object and thought that a similar technique could be applied and set about creating a sample project.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I followed the same steps as detailed in my reply:&lt;/span&gt;&lt;/span&gt;&lt;span class="messagecontent"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;1) Create a new windows form app&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2) Add to the form 2x picture boxes, one named source, the other dest&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;3) Add a new button named serialise&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;4) Set the background image of the picturebox named source to whatever you want&lt;br /&gt;(for testing, do this using the designer)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;5) Add a handler to the buttons click event&lt;/span&gt;&lt;/span&gt;&lt;span class="messagecontent"  style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;(this normally happens automatically if you double click the button in the designer)&lt;/span&gt;&lt;/span&gt;&lt;span class="messagecontent"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;6) Add &lt;/span&gt;&lt;code  style="font-family:courier new;"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;using System.Runtime.Serialization.Formatters.Binary;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt; &lt;/span&gt;declaration to your class&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;7) Paste the following code:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;&lt;span&gt;&lt;span class="messagecontent"&gt;  void SerialiseClick(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;//serialise the background image of the source&lt;br /&gt;byte[] byteArray = Serialise( source.BackgroundImage );&lt;br /&gt;//deserialise the background image into the dest&lt;br /&gt;dest.BackgroundImage = (System.Drawing.Image)Deserialise(byteArray);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static byte[] Serialise( object obj )&lt;br /&gt;{&lt;br /&gt;//instanciate a new memory stream&lt;br /&gt;System.IO.MemoryStream ms = new System.IO.MemoryStream();&lt;br /&gt;//instanciate a new BinaryFormatter&lt;br /&gt;BinaryFormatter bf = new BinaryFormatter();&lt;br /&gt;//serialise the object into the memory stream&lt;br /&gt;bf.Serialize( ms, obj );&lt;br /&gt;//return the memory stream as a byte array&lt;br /&gt;return ms.ToArray();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static object Deserialise( byte[] obj )&lt;br /&gt;{&lt;br /&gt;//read the object into a memory stream&lt;br /&gt;System.IO.MemoryStream ms = new System.IO.MemoryStream( obj );&lt;br /&gt;//instanciate a binary formatter&lt;br /&gt;BinaryFormatter bf = new BinaryFormatter();&lt;br /&gt;//return the deserialised byte array as an object&lt;br /&gt;return bf.Deserialize(ms) ;&lt;br /&gt;}  &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;With any luck, when the application is run, the resulting form should look similar to the one as pictured bellow:&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uzzJClN3sBM/Rdcu72DUhXI/AAAAAAAAAAo/Th4vc7Z3uhQ/s1600-h/Before.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_uzzJClN3sBM/Rdcu72DUhXI/AAAAAAAAAAo/Th4vc7Z3uhQ/s400/Before.bmp" alt="" id="BLOGGER_PHOTO_ID_5032542714266420594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;If the code was pasted correctly, clicking the '&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:85%;"  &gt;Serialise&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;' button should invove the buttons click method where:&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;the background of the source image is serialised into a byte array&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;the byte array is de-serialised into an image&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;the image is set as the background of the destination  image&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;This should result in the image being displayed in the '&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:85%;"  &gt;Serialised Image&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;' picture box which would therfor look as follows:&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_uzzJClN3sBM/RdcwrWDUhYI/AAAAAAAAAAw/mBARQxC2rm0/s1600-h/After.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_uzzJClN3sBM/RdcwrWDUhYI/AAAAAAAAAAw/mBARQxC2rm0/s400/After.bmp" alt="" id="BLOGGER_PHOTO_ID_5032544629821834626" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The sample project can be downloaded from here: &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.box.net/public/14kiat6na7"&gt;http://www.box.net/public/14kiat6na7&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The original post can be viewed here: &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.codeproject.com/script/comments/forums.asp?forumid=1649&amp;mode=all&amp;amp;select=1898735&amp;df=100&amp;amp;fr=48.5#xx1898735xx"&gt;CodeProject C# Forum&lt;/a&gt;&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18580676-9163513458575143345?l=codefrenzy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codefrenzy.blogspot.com/feeds/9163513458575143345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18580676&amp;postID=9163513458575143345' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/9163513458575143345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/9163513458575143345'/><link rel='alternate' type='text/html' href='http://codefrenzy.blogspot.com/2007/02/how-to-serialise-image.html' title='How to Serialise Image'/><author><name>Wayne Phipps</name><uri>http://www.blogger.com/profile/03399910634594530719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/blogger/4886/1812/1600/Me.0.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uzzJClN3sBM/Rdcu72DUhXI/AAAAAAAAAAo/Th4vc7Z3uhQ/s72-c/Before.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18580676.post-115641785970746002</id><published>2006-08-24T11:11:00.000+01:00</published><updated>2006-08-24T12:55:59.176+01:00</updated><title type='text'>Reading and writing a BLOB from Firebird</title><content type='html'>I'ts been a long time since I've written anything  so I thought I'd make it usefull.&lt;br /&gt;&lt;br /&gt;For those of you who don't know, a BLOB is a Binary Large Object and is a data type for storing binary (and text) data in a database.&lt;br /&gt;&lt;br /&gt;It could be used for storing images, files etc in a database for later retrieval or even to persist objects.&lt;br /&gt;&lt;br /&gt;There are scarce resources on the Internet relating to this subject in relation to the Firebird database. Whilst researching this topic, many of the links I found led me back to the following page:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetfirebird.org/blob-reading-example-csharp"&gt;http://www.dotnetfirebird.org/blob-reading-example-csharp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'ts a great site and many people link to it, however you would be mislead to think that this was the only method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The code which follows assumes that a database table named &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;BLOB_DATA&lt;/span&gt;&lt;/span&gt; already exists and contains the columns &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;ID&lt;/span&gt;&lt;/span&gt; and &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;DATA&lt;/span&gt;&lt;/span&gt;, a similar table could be ctreated by executing the following script:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;--==============================================================&lt;br /&gt;--    Create Tables&lt;br /&gt;--==============================================================&lt;br /&gt;CREATE TABLE BLOB_DATA (&lt;br /&gt;   ID                    INTEGER NOT NULL,&lt;br /&gt;   DATA                BLOB NOT NULL,&lt;br /&gt;   PRIMARY KEY            (ID) );&lt;br /&gt;&lt;br /&gt;--==============================================================&lt;br /&gt;--    Create Generators for Auto Increment Primary Keys&lt;br /&gt;--==============================================================&lt;br /&gt;CREATE GENERATOR GEN_BLOB_DATA;&lt;br /&gt;&lt;br /&gt;--==============================================================&lt;br /&gt;--    Create Triggers for Auto Increment Primary Keys&lt;br /&gt;--==============================================================&lt;br /&gt;SET TERM ^ ;&lt;br /&gt;CREATE TRIGGER ID FOR BLOB_DATA&lt;br /&gt;ACTIVE BEFORE INSERT&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt; IF(NEW.ID IS NULL) THEN&lt;br /&gt;   NEW.ID = GEN_ID(GEN_BLOB_DATA, 1);&lt;br /&gt;END^&lt;br /&gt;SET TERM ; ^&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The following code will store a BLOB from a Firebird database:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        public void SaveBlob( byte[] data )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //instanciate a new connection string builder&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            FbConnectionStringBuilder csb = new FbConnectionStringBuilder();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            csb.Database     = "MyDatabase";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            csb.UserID         = "SYSDBA";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            csb.Password     = "masterkey";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            csb.ServerType     = 1;             //embedded server&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //instanciate a connection object&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            FbConnection con = new FbConnection(csb.ToString());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //build the query&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            cmd = new FbCommand( "INSERT INTO BLOB_DATA VALUES ( null, @data )", con );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //add the parameters&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            cmd.Parameters.Add( "@data", data );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //open the connectoin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            con.Open();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //execute the query&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            cmd.ExecuteNonQuery();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //close the connection&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            con.Close();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;/span&gt;&lt;br /&gt;The following code will read BLOB data from a Firebird dataase:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;        public byte[] ReadBlob( int id )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //instanciate a new connection string builder&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            FbConnectionStringBuilder csb = new FbConnectionStringBuilder();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            csb.Database     = "MyDatabase";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            csb.UserID         = "SYSDBA";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            csb.Password     = "masterkey";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            csb.ServerType     = 1;             //embedded server&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //instanciate a connection object&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            FbConnection con = new FbConnection(csb.ToString());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //build the query&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            cmd = new FbCommand( "SELECT * FROM BLOB_DATA WHERE ID = @id", con );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //add the parameters&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            cmd.Parameters.Add( "@id", id );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //open the connectoin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            con.Open();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //execute the query&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            FbDataReader reader = cmd.ExecuteReader();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            byte[] data = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //read the data&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            while ( reader.Read() )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                data = (byte[])reader["DATA"] ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            //close the connection&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            con.Close();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            return data;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;In the real world, you wouldn't instanciate a new connection string in each method, the database routines would possibly be static methods inside a sealed class. This was just a quick'n'dirty demonstration of a simple method to achieve the required results.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18580676-115641785970746002?l=codefrenzy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codefrenzy.blogspot.com/feeds/115641785970746002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18580676&amp;postID=115641785970746002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/115641785970746002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/115641785970746002'/><link rel='alternate' type='text/html' href='http://codefrenzy.blogspot.com/2006/08/reading-and-writing-blob-from-firebird.html' title='Reading and writing a BLOB from Firebird'/><author><name>Wayne Phipps</name><uri>http://www.blogger.com/profile/03399910634594530719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/blogger/4886/1812/1600/Me.0.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18580676.post-114029564401465682</id><published>2006-02-18T20:29:00.000Z</published><updated>2006-02-20T13:29:54.106Z</updated><title type='text'>PING can hurt!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/4886/1812/1600/Epson%20TM-U220.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/4886/1812/320/Epson%20TM-U220.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Who would have thought that a simple PING command could ever cause any problems?&lt;br /&gt;&lt;br /&gt;There have been many occasions when I've tested network connections using this simple command and even used a Ping utility like &lt;a href="http://www.angryziber.com/ipscan/"&gt;Angry IP Scanner&lt;/a&gt; to see what IP addresses were active.&lt;br /&gt;&lt;br /&gt;Well, you can only imaging my surprise when all hell broke loose whilst investigating a problem with an &lt;a href="http://pos.epson.com/products/tm-u220.htm"&gt;Epson TM-U220&lt;/a&gt; Printer fitted with an Ethernet Interface.&lt;br /&gt;&lt;br /&gt;We had several printers connected to an isolated network that had been setup for a demonstration. One of the printers (not an Epson) had stopped working and I was asked to investigate. None of the original configuration had changed since the earlier demo where it was left in a working condition.&lt;br /&gt;&lt;br /&gt;I used the Ping utility to test for responding equipment and observed the Epson TM-U220 print a configuration ticket that showed the IP address had changed. This only occurred occasionally.&lt;br /&gt;&lt;br /&gt;Eventually, I discovered that this only happened when the Ping utility was set to scan all the IP addresses on the subnet including the broadcast IP (EG 192.168.1.255).&lt;br /&gt;&lt;br /&gt;At first I thought that there could be a fault with the utility that caused this strange problem with the printer. To test this theory, I performed a PING from the command prompt that fortunately had the same affect and caused the printer to print another configuration ticket.&lt;br /&gt;&lt;br /&gt;The first problem was that each time the printer was reconfigured, it was set to use the broadcast address. The implication of this is that, every machine on the same subnet hears any message sent to the broadcast IP. Imagine sending a print request to the broadcast IP and having all the printers print the same message!&lt;br /&gt;&lt;br /&gt;The second problem is that, once set to the broadcast address, the normal programming utilities would not work, they couldn’t connect to the broadcast address.&lt;br /&gt;&lt;br /&gt;I realised that we had to connect using the hardware (MAC) address but hadn’t done this before. As we were running out of time, I prepared two other replacement printers. This left me with the challenge of fixing the problem printers in my spare time.&lt;br /&gt;&lt;br /&gt;With some help from a colleague, we eventually discovered that we could get the printer back to its correct IP address using a combination of ARP (Address Resolution Protocol) and PING commands.&lt;br /&gt;&lt;br /&gt;This is how:&lt;br /&gt;&lt;br /&gt;Make a note of the printers Ethernet Address, this was printed on the configuration ticket. You can often force the printer to print this information by pressing the reset button near the RJ45 socket of the network card. There may also be a label by the port stating this address.&lt;br /&gt;Once you known the Ethernet address of the printer, simply use the ARP command as follows:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(153, 0, 0);font-family:Courier New;font-size:85%;"  &gt;arp -s 192.168.0.173 00-20-7F-CB-37-77&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;This command tells the printer that has a Ethernet address of 00-20-7F-CB-37-77 to change its IP address to 192.168.0.173.&lt;br /&gt;&lt;br /&gt;To actually change the IP address of the printer, use the PING command to send the ARP information just specified as follows:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(153, 0, 0);font-family:Courier New;font-size:85%;"  &gt;PING 192.168.0.173&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;The above procedure would add an entry to the ARP table on the PC from which the command was performed. This can be deleted as follows:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(153, 0, 0);font-family:Courier New;font-size:85%;"  &gt;arp -d 192.168.0.173&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;The printer should now have the required IP address and should connect to the configuration software should any further changes be required.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I am sure that this problem is not specific to the Epson printer however, this is my first experience of what could have been a major problem.&lt;br /&gt;&lt;br /&gt;It is also worth noting that the configuration software also has an option to disable programming by PING although I do not know the implications of disabling this.&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:lucida grande;font-size:12;"  &gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:lucida grande;"&gt;In my search for a solution, I found the following references useful:&lt;/span&gt;&lt;span style=";font-family:lucida grande;font-size:100%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://www.dhtechnology.com.au/downloads_TM-U220B-202"&gt;DH Technology Support Page for Epson TM-U220B&lt;/a&gt;&lt;span style=";font-family:lucida grande;font-size:12;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=";font-family:lucida grande;font-size:12;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: center;"&gt;&lt;span style=";font-family:lucida grande;font-size:85%;"  &gt;&lt;span style="font-size:12;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://solutions.brother.com/Library/faq/printer/prfaq0136/prfaq0136.html"&gt;&lt;span style="font-size:85%;"&gt;Using the ARP and PING                         commands to change the IP address&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;I hope this saves someone the torment we suffered.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18580676-114029564401465682?l=codefrenzy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codefrenzy.blogspot.com/feeds/114029564401465682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18580676&amp;postID=114029564401465682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/114029564401465682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/114029564401465682'/><link rel='alternate' type='text/html' href='http://codefrenzy.blogspot.com/2006/02/ping-can-hurt.html' title='PING can hurt!'/><author><name>Wayne Phipps</name><uri>http://www.blogger.com/profile/03399910634594530719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/blogger/4886/1812/1600/Me.0.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18580676.post-113096757422882126</id><published>2005-11-02T21:39:00.000Z</published><updated>2005-11-05T14:15:05.543Z</updated><title type='text'>Run an embedded SQL Script against Firebird</title><content type='html'>&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;I had an idea that it would be great if my application could automatically create any database that it required.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;I have in the past attempted to hardcode database construction routines but dislike this approach as it makes the code messy and difficult to maintain. Instead, I favoured the idea of executing a script containing my SQL statements which could be used to construct the database. The application would just simply execute the script, an approach I’ve used in the past with SQL Sever.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;Whilst investigating further, I found these useful links:&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;a href="http://www.dotnetfirebird.org/blog/2005/03/using-fbconnectionstringbuilder.html"&gt;Using FbConnectionStringBuilder&lt;/a&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;a href="http://www.dotnetfirebird.org/blog/2005/03/batch-sqlddl-execution.html"&gt;Batch SQL/DDL Execution&lt;/a&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;However, distributing a separate script file would allow a user to change or view the contents of the file.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;Having experimented with embedded resource files, I thought a similar approach would protect the script from abuse by the average user and only venerable to experienced programmers.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;I tested various routines and arrived at the following working example:&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;void ButtonRunScriptClick(object sender, System.EventArgs e)&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;{&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//specify the database name&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;string dbName = "test.fdb";&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//instanciate a new connection stringbuilder&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;FbConnectionStringBuilder csb = new FbConnectionStringBuilder();&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;csb.Database = dbName;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;csb.UserID = "SYSDBA";&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;csb.Password = "masterkey";&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;csb.ServerType = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //embedded server&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//instanciate a connection object&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;FbConnection con = new FbConnection(csb.ToString());&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//check if the database exists&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;if (System.IO.File.Exists(dbName) == false)&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//create the database as it didn’t exist&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;FbConnection.CreateDatabase(csb.ToString());&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//run the script against the current connection&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;RunScript("Test.Sql", con);&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;void RunScript(string ScriptName, FbConnection connection)&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;{&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//get a reference to the executing assembly&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//instanciate a textReader object initialised using a stream to the embedded resource&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;System.IO.TextReader textReader = new System.IO.StreamReader(assembly.GetManifestResourceStream(ScriptName));&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;FbScript script = new FbScript(textReader);&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//parse the script&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;script.Parse();&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//open the connection&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;connection.Open();&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;FbBatchExecution fbe = new FbBatchExecution(connection);&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;foreach (string cmd in script.Results)&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;{&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//add each sql statement to the batch&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;fbe.SqlStatements.Add(cmd);&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//execute the batch&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;fbe.Execute();&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;//close the connection&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;connection.Close();&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;To test the above code, you will need to do the following:&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Download and install the 'Firebird ADO.Net Provider' from &lt;/span&gt;&lt;a href="http://www.dotnetfirebird.org/download/"&gt;DotNetFirebird&lt;/a&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Once installed, create a new Windows Application and add a reference to your project for the FirebirdSql.Data.Firebird assebly loaded in the GAC.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Copy &amp; Paste the sample code into your project.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Add the following Using Directives:&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;using FirebirdSql.Data.Firebird;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;using FirebirdSql.Data.Firebird.Isql;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Download 'Embedded Firebird for Windows' from &lt;/span&gt;&lt;a href="http://www.dotnetfirebird.org/download/"&gt;DotNetFirebird&lt;/a&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt; and extract ‘fbembed.dll’ and ‘firebird.msg’ from the zip archive. These files should be copied to your applications directory.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;6)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Create a text file named 'Test.Sql' to contain your Firebird SQL script and save it in your project directory. I would suggest including a CREATE TABLE statement such as:&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;CREATE TABLE CLIENTS (&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;client_id integer not null,&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;firstname char(20),&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;lastname char(20),&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;PRIMARY KEY (client_id));&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;Note: The filename is case sensitive, if you choose a different filename you will need to amend the sample code to reflect this change.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;7)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Add the file you created in Step 4 to your project and set the build action to Embedded Resource.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;8)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Add a button to your form named buttonRunScript and check that its Click Event is set to the ButtonRunScriptClick Event Handler.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;Hopefully, when you build the project and click the Run Script button, a file will be created in the applications directory named ‘TEST.FDB’.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;Providing there were no errors during the applications execution the database should have been constructed according to the statements in the SQL script.&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt;There are several Database Admin Tools you can use to inspect/update and alter the database, one of which is &lt;/span&gt;&lt;a href="http://www.flamerobin.org/"&gt;FlameRobin&lt;/a&gt;&lt;span style="font-family:Trebuchet MS;font-size:78%;"&gt; which can also be downloaded for free.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18580676-113096757422882126?l=codefrenzy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codefrenzy.blogspot.com/feeds/113096757422882126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18580676&amp;postID=113096757422882126' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/113096757422882126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/113096757422882126'/><link rel='alternate' type='text/html' href='http://codefrenzy.blogspot.com/2005/11/run-embedded-sql-script-against.html' title='Run an embedded SQL Script against Firebird'/><author><name>Wayne Phipps</name><uri>http://www.blogger.com/profile/03399910634594530719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/blogger/4886/1812/1600/Me.0.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18580676.post-113096772782995338</id><published>2005-11-01T05:00:00.000Z</published><updated>2005-11-02T21:43:25.393Z</updated><title type='text'>C# Programming using SharpDevelop</title><content type='html'>SharpDevelop is a great IDE for developing C# applications. Best of all, its free.&lt;br /&gt;&lt;br /&gt;Yes, thats right, free and can be downloaded from &lt;a href="http://www.icsharpcode.net/"&gt;www.icsharpcode.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Don't get me wrong, I once loved Visual Studio. Not only is it a great IDE but it gave me loads of ideas. What I now hate about the product is that its written by Microsoft.&lt;br /&gt;&lt;br /&gt;My main reason for my dislike was because I have purchased several Microsoft products:&lt;br /&gt;&lt;br /&gt;  Visual C++ v6 Deluxe Learning Edidtion (DLE)&lt;br /&gt;  Visual Studio .Net v2000&lt;br /&gt;&lt;br /&gt;When I purchased VS C++ DLE, after writting several sample applications, I was disapointed to find the license did not allow me to distribute any application made with the package.&lt;br /&gt;&lt;br /&gt;Several years on, I purchased VS.Net 2000 when I started a distance learning course. When VS.2002 was released, Microsoft offered an upgrade for a small fee (approx £19). I was annoyed to discover that because the version I had purchased was "An Accademic Version", the upgrade offer was not applicable.&lt;br /&gt;&lt;br /&gt;Having never distributed any application, I could not warrant spending £700-800 on the new version. I scoured the Google in anger for &lt;a href="http://www.google.co.uk/search?hl=en&amp;q=Open+Source+C%23+IDE&amp;amp;btnG=Google+Search&amp;amp;meta="&gt;Open Source C# IDE&lt;/a&gt; and found SharpDevelop.&lt;br /&gt;&lt;br /&gt;I must admit, its not perfect, but neither is Visual Studio. But because of my past experiences, I'm doing what I can to stop using Microsoft Products and support others to develop alternatives.&lt;br /&gt;&lt;br /&gt;I no longer use Internet Explorer, instead I use &lt;a href="http://www.mozilla.org/products/firefox/"&gt;Firefox&lt;/a&gt;.&lt;br /&gt;I dont use SQL Server, instead I've used MySQLServer or &lt;a href="http://firebird.sourceforge.net/index.php?op=files"&gt;Firebird&lt;/a&gt;.&lt;br /&gt;I dont use Visual Studio, instead I used &lt;a href="http://www.icsharpcode.net/"&gt;SharpDevelop&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What would you do?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18580676-113096772782995338?l=codefrenzy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codefrenzy.blogspot.com/feeds/113096772782995338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18580676&amp;postID=113096772782995338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/113096772782995338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/113096772782995338'/><link rel='alternate' type='text/html' href='http://codefrenzy.blogspot.com/2005/10/c-programming-using-sharpdevelop.html' title='C# Programming using SharpDevelop'/><author><name>Wayne Phipps</name><uri>http://www.blogger.com/profile/03399910634594530719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/blogger/4886/1812/1600/Me.0.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18580676.post-113096802490627401</id><published>2005-10-31T21:19:00.000Z</published><updated>2006-08-15T00:31:48.180+01:00</updated><title type='text'>Adventures into the world of C#</title><content type='html'>I'm yet again of on another journey of exploration. I think it's this constant learning curve that makes programming so interesting.&lt;br /&gt;&lt;br /&gt;This time i'm investigating usung Firefox as the back-end of a C# application.&lt;br /&gt;&lt;br /&gt;I've started using the embedded version as it can be easily distributed and installed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18580676-113096802490627401?l=codefrenzy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codefrenzy.blogspot.com/feeds/113096802490627401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18580676&amp;postID=113096802490627401' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/113096802490627401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18580676/posts/default/113096802490627401'/><link rel='alternate' type='text/html' href='http://codefrenzy.blogspot.com/2005/10/adventures-into-world-of-c.html' title='Adventures into the world of C#'/><author><name>Wayne Phipps</name><uri>http://www.blogger.com/profile/03399910634594530719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/blogger/4886/1812/1600/Me.0.jpg'/></author><thr:total>2</thr:total></entry></feed>
