<?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-6354706590059817737</id><updated>2012-02-16T01:29:38.092-08:00</updated><category term='GML'/><category term='Interview Questions For GIS'/><category term='POSTGIS'/><title type='text'>Sharp Minders</title><subtitle type='html'>The sharp minders blog contains the technical articles related to .Net programming language. This blog also contains some informative articles about GIS.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-1577882833437632546</id><published>2009-03-05T03:06:00.000-08:00</published><updated>2009-03-05T03:32:31.109-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GML'/><title type='text'>Geography Markup Language</title><content type='html'>The &lt;b&gt;Geography Markup Language&lt;/b&gt; (&lt;b&gt;GML&lt;/b&gt;) is the &lt;a href="http://en.wikipedia.org/wiki/XML" title="XML"&gt;XML&lt;/a&gt; grammar defined by the &lt;a href="http://en.wikipedia.org/wiki/Open_Geospatial_Consortium" title="Open Geospatial Consortium"&gt;Open Geospatial Consortium&lt;/a&gt; (OGC) to express geographical features. GML serves as a modeling language for geographic systems as well as an open interchange format for geographic transactions on the Internet. Note that the concept of feature in GML is a very general one and includes not only conventional "vector" or discrete objects, but also coverages (see also GMLJP2) and sensor data. The ability to integrate all forms of geographic information is key to the utility of GML.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;GML Model&lt;br /&gt;&lt;/span&gt;&lt;p&gt;The original GML model was based on the &lt;a href="http://en.wikipedia.org/wiki/World_Wide_Web_Consortium" title="World Wide Web Consortium"&gt;World Wide Web Consortium&lt;/a&gt;'s &lt;a href="http://en.wikipedia.org/wiki/Resource_Description_Framework" title="Resource Description Framework"&gt;Resource Description Framework&lt;/a&gt; (RDF). Subsequently, the OGC introduced &lt;a href="http://en.wikipedia.org/wiki/XML_Schema_%28W3C%29" title="XML Schema (W3C)"&gt;XML schemas&lt;/a&gt; into GML's structure to help connect the various existing geographic databases, whose relational structure XML schemas more easily define. The resulting XML-schema-based GML retains many features of RDF, including the idea of child elements as properties of the parent object (RDFS) and the use of remote property references.&lt;/p&gt; &lt;p&gt;GML contains a rich set of primitives which are used to build application specific schemas or application languages. These primitives include:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Geography_Markup_Language#Features" title=""&gt;Feature&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Geometry&lt;/li&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Geography_Markup_Language#Coordinate_Reference_System" title=""&gt;Coordinate Reference System&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Time&lt;/li&gt;&lt;li&gt;Dynamic feature&lt;/li&gt;&lt;li&gt;Coverage (including geographic images)&lt;/li&gt;&lt;li&gt;Unit of measure&lt;/li&gt;&lt;li&gt;Map presentation styling rule&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-1577882833437632546?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/1577882833437632546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=1577882833437632546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/1577882833437632546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/1577882833437632546'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2009/03/geography-markup-language.html' title='Geography Markup Language'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-3275250004010326098</id><published>2009-03-02T21:42:00.000-08:00</published><updated>2009-03-02T21:49:33.351-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='POSTGIS'/><title type='text'>POSTGIS</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;POSTGIS&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-weight: bold;"&gt;What is POSTGIS&lt;br /&gt;&lt;/span&gt;&lt;p&gt;PostGIS is an extension for PostgreSQL RDBMS that spatially enables it for storing GIS content.&lt;/p&gt; &lt;p&gt;It could be considered something similiar to Esri ArcSDE or Oracle Spatial.&lt;br /&gt;In fact PostGIS is for PostgreSQL what is Esri ArcSDE for Oracle, MS SQL Server, Informix, DB2.&lt;/p&gt; &lt;p&gt;PostGIS is OGC compliant and is Open Source, released under the &lt;a href="http://www.gnu.org/copyleft/gpl.html"&gt;GNU &lt;/a&gt; General Public License.&lt;/p&gt; &lt;p&gt;For more info about PostGIS you can take a look &lt;a href="http://postgis.refractions.net/documentation"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Create POSTGIS Database&lt;/span&gt;&lt;/p&gt;&lt;p&gt;First create the PostgreSQL database, using PostgreSQL in the command window or the pgAdmin III SQL window, typing:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql"&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;CREATE&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;DATABASE&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"TUTORIAL"&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;WITH&lt;/span&gt; OWNER = psqluser&lt;br /&gt;      ENCODING = &lt;span style="color: rgb(255, 0, 0);"&gt;'UTF8'&lt;/span&gt;&lt;br /&gt;      TABLESPACE = pg_default;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;After creating the database you have to enable it for storing, with PostGIS, the geographic information.&lt;br /&gt;For doing so you have to enable PL/pgSQL procedural language extension.&lt;/p&gt; &lt;p&gt;You have to use the createlang command (under Windows use the command prompt, under the PostgreSQL’s bin folder):&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash"&gt;createlang plpgsql -U psqluser -D TUTORIAL&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Now you can succesfully load the PostGIS objects and functions by the lwpostgis.sql script.&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash"&gt;psql -U psqluser -d TUTORIAL -f lwpostgis.sql&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;After doing so, you can see that a lot of object and functions are now loaded in TUTORIAL database. &lt;/p&gt; &lt;p&gt;This objects and functions are necessary for PostGIS to work.&lt;/p&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Load Data In POSTGIS&lt;br /&gt;&lt;/span&gt;&lt;p&gt;There are several ways in order to load geometry objects in PostGIS.&lt;/p&gt; &lt;p&gt;It is possible to load data using SQL, or using the Loader utility (shp2pgsql command, similiar to the shp2sde command for ArcSDE). In fact the loader utility is a command that will generate the SQL with the INSERT statment to load geometries in PostGIS.&lt;/p&gt; &lt;p&gt;Let’s see this two ways.&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;1. Load Data In POSTGIS  Using SQL&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Create a table named TEST:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql"&gt;BEGIN;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;CREATE&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;TABLE&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"test"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"id"&lt;/span&gt; int4, &lt;span style="color: rgb(255, 0, 0);"&gt;"name"&lt;/span&gt; varchar&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;20&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;SELECT&lt;/span&gt; AddGeometryColumn&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;''&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'test'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'the_geom'&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;'-1'&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;'LINESTRING'&lt;/span&gt;,&lt;span style="color: rgb(204, 102, 204);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;END;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Let’s load the first linestring gis object in this table, using the GeomFromText function:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql"&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"test"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"id"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"name"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"the_geom"&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;1&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;'First Geometry'&lt;/span&gt;, GeomFromText&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'LINESTRING(1 1,2 2,3 3,3 4)'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Let’s retrieve this GIS object with the database:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash"&gt;SELECT id, name, the_geom FROM TEST;&lt;br /&gt;&lt;br /&gt;&gt; &lt;span style="color: rgb(204, 102, 204);"&gt;1&lt;/span&gt;;&lt;span style="color: rgb(255, 0, 0);"&gt;"First Geometry"&lt;/span&gt;;&lt;span style="color: rgb(255, 0, 0);"&gt;"01020000..."&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;As we can notice, the geometry information with a simple SELECT statment is retrieved as is stored in PostGIS database: as a binary string.&lt;/p&gt; &lt;p&gt;If we wan’t to retrieve the geometry information as a simple Open GIS Well Known Text Format string, we can use another function that was created in the TUTORIAL database by the lwpostgis.sql script: AsText&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash"&gt;SELECT id, name, AsText&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; FROM TEST;&lt;br /&gt;&lt;br /&gt;&gt; &lt;span style="color: rgb(204, 102, 204);"&gt;1&lt;/span&gt;;&lt;span style="color: rgb(255, 0, 0);"&gt;"First Geometry"&lt;/span&gt;;&lt;span style="color: rgb(255, 0, 0);"&gt;"LINESTRING(1 1,2 2,3 3,3 4)"&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;2. &lt;/span&gt;&lt;/span&gt;&lt;strong style="font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Load data (shapefiles) in PostGIS using the shp2pgsql command&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="font-family: Georgia,serif;"&gt;&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;To load shapefiles in PostGIS database you can use the Loader utility: the shp2pgsql command (under bin’s folder). This utility simply creates from any shapefile an sql file that can be used in PostGIS to load the shapefile in the database.&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: monospace;"&gt;&lt;/span&gt;We will now load the tutorial’s shapefiles (compfun.shp, poi.shp, vestizioni.shp, zone.shp) into the TUTORIAL database we created with PostGIS.&lt;/p&gt; &lt;p&gt;First we will use the shp2pgsql command to produce the sql files:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash"&gt;shp2pgsql C:\training\mapServerTutorial\data\poi.shp poi &gt; C:\training\mapServerTutorial\data\poi.sql&lt;br /&gt;shp2pgsql C:\training\mapServerTutorial\data\compfun.shp compfun &gt; C:\training\mapServerTutorial\data\compfun.sql&lt;br /&gt;shp2pgsql C:\training\mapServerTutorial\data\vestizioni.shp vestizioni &gt; C:\training\mapServerTutorial\data\vestizioni.sql&lt;br /&gt;shp2pgsql C:\training\mapServerTutorial\data\zone.shp zone &gt; C:\training\mapServerTutorial\data\zone.sql&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Now we can use the 4 sql files produced with PostGIS: these sql files will phisically load the shapefile geometries in 4 PostGIS tables.&lt;/p&gt; &lt;p&gt;Executing the poi.sql script will create in TUTORIAL database the poi table:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql"&gt;BEGIN;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;CREATE&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;TABLE&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"poi"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;gid serial &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;KEY&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"poi_time"&lt;/span&gt; varchar, &lt;span style="color: rgb(255, 0, 0);"&gt;"poi_user"&lt;/span&gt; varchar&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;SELECT&lt;/span&gt; AddGeometryColumn&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;''&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'poi'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'the_geom'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'-1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'POINT'&lt;/span&gt;,&lt;span style="color: rgb(204, 102, 204);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"poi"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"poi_time"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"poi_user"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'04/08/2006, 16.23.41'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'Paolo'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'0101000000713D0A170A7A3141B81E853B33DB5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"poi"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"poi_time"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"poi_user"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'04/08/2006, 16.24.09'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'Paolo'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'01010000005C8FC2D5FB79314152B81E9971DB5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;END;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Executing the compfun.sql script will create in TUTORIAL database the compfun table:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql"&gt;BEGIN;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;CREATE&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;TABLE&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"compfun"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;gid serial &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;KEY&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt; int8, &lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt; int8, &lt;span style="color: rgb(255, 0, 0);"&gt;"shape_area"&lt;/span&gt; numeric, &lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt; numeric&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;SELECT&lt;/span&gt; AddGeometryColumn&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;''&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'compfun'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'the_geom'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'-1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'MULTIPOLYGON'&lt;/span&gt;,&lt;span style="color: rgb(204, 102, 204);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"compfun"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_area"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'4052'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'3.45349032455e+006'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'8.16732468815e+003'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'0106000000010000000103000000010000001D00000040996FAA397B3141E07CD98012DC50414016BF4B637B314120EDD71DF2DB5041C0C48863797C3141C026D7070CDC5041C08D9B964B7D3141C040084D8DDB504100750AE32F7B3141102BE15F19DB5041809E6B9AC87A3141906226D602DB504180B38C4A967931410077244BC0DA504100CCFE59B177314160708AEE51DA504180DD9DBA9F76314100C6939B17DA5041C04FAAF651763141706CA3D154DA504140EF3C1B8E7531411049C4A0EFDA5041003A43365D753141004DABBDECDA5041000172392C753141B0E26CBB34DB5041C080CC767F743141F057440D93DB5041402243CBBE74314110CE02459ADB5041003E9495AA743141603B417EA6DB5041C04DC6C64E753141E05D04A8BADB5041402243CBBE7431416060D6F125DC5041C080CC767F743141C0C546F137DC5041809068EA7374314150E422FE4EDC5041805FFBE4EC743141B00EB4615DDC5041403275FC62753141F05CE8A069DC504100C2B632047631414029A95177DC504140BA7EB6B97631419096E78A83DC5041C094C6072A773141C0A93C2E8CDC50410017E6B7897931416003F8D6A6DC504100DC11CE5E7A3141A0551333B0DC5041C0B399BBFB7A3141D0664F850DDC504140996FAA397B3141E07CD98012DC5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;END;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Executing the vestizioni.sql script will create in TUTORIAL database the vestizioni table:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql"&gt;BEGIN;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;CREATE&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;TABLE&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"vestizioni"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;gid serial &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;KEY&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt; int8, &lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt; int8, &lt;span style="color: rgb(255, 0, 0);"&gt;"classe"&lt;/span&gt; int4, &lt;span style="color: rgb(255, 0, 0);"&gt;"tipo"&lt;/span&gt; int4, &lt;span style="color: rgb(255, 0, 0);"&gt;"cod"&lt;/span&gt; int4, &lt;span style="color: rgb(255, 0, 0);"&gt;"origine"&lt;/span&gt; int4, &lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt; numeric&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;SELECT&lt;/span&gt; AddGeometryColumn&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;''&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'vestizioni'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'the_geom'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'-1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'MULTILINESTRING'&lt;/span&gt;,&lt;span style="color: rgb(204, 102, 204);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"vestizioni"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"classe"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"tipo"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"cod"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"origine"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'89833'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'8'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2.14449030864e+001'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'010500000001000000010200000002000000403738813D7C3141A08D27B907DC5041800BC76B457C314190779DBD02DC5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"vestizioni"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"classe"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"tipo"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"cod"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"origine"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'89834'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'8'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'5.51685811591e+000'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'01050000000100000001020000000200000040DFB2743B7C3141B0E4FA0009DC5041403738813D7C3141A08D27B907DC5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"vestizioni"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"classe"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"tipo"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"cod"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"origine"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'89835'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'8'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'9.23513291375e+000'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'01050000000100000001020000000200000040CB8C02387C3141C0C057250BDC504140DFB2743B7C3141B0E4FA0009DC5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;/*&lt;br /&gt;other omitted INSERT statments...&lt;br /&gt;*/&lt;/span&gt;&lt;br /&gt;END;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Executing the zone.sql script will create in TUTORIAL database the zone table:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql"&gt;BEGIN;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;CREATE&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;TABLE&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"zone"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;gid serial &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;KEY&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt; int8, &lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt; int8, &lt;span style="color: rgb(255, 0, 0);"&gt;"classe"&lt;/span&gt; int4, &lt;span style="color: rgb(255, 0, 0);"&gt;"tipo"&lt;/span&gt; int4, &lt;span style="color: rgb(255, 0, 0);"&gt;"cod"&lt;/span&gt; int4, &lt;span style="color: rgb(255, 0, 0);"&gt;"numlott"&lt;/span&gt; int8, &lt;span style="color: rgb(255, 0, 0);"&gt;"lottoid"&lt;/span&gt; numeric, &lt;span style="color: rgb(255, 0, 0);"&gt;"shape_area"&lt;/span&gt; numeric, &lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt; numeric&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;SELECT&lt;/span&gt; AddGeometryColumn&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;''&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'zone'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'the_geom'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'-1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'MULTIPOLYGON'&lt;/span&gt;,&lt;span style="color: rgb(204, 102, 204);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"zone"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"classe"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"tipo"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"cod"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"numlott"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"lottoid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_area"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'46929'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'7'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'107'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'117'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2.80111700000e+006'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'5.68543477776e+003'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'3.01854931948e+002'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'0106000000010000000103000000010000000700000040900304607A3141900DF7EA83DB5041C0D4C76B7C7A3141205BC65C72DB5041C0E425CB7C7A314120791E9271DB5041C0E80CE8797A3141201B4EDF70DB5041803FC859407A3141F018096069DB5041C07A13F7207A314160903B487DDB504140900304607A3141900DF7EA83DB5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"zone"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"classe"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"tipo"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"cod"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"numlott"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"lottoid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_area"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'46935'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'7'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'107'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'110'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2.80111000000e+006'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'6.65516688758e+003'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'3.94268253922e+002'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'01060000000100000001030000000100000007000000008FFB54307A314140C89894A1DB504180AF5AF5427A314100B92A0E96DB5041408C671FB9793141B0F4188D88DB50410008CE1BAD793141E063DA5990DB5041C03447E0D4793141F070036194DB5041C0C0EC31CF7931411030BA1498DB5041008FFB54307A314140C89894A1DB5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INSERT&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;INTO&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"zone"&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"objectid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"codarea"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"classe"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"tipo"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"cod"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"numlott"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"lottoid"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_area"&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;"shape_len"&lt;/span&gt;,the_geom&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 51, 51); font-weight: bold;"&gt;VALUES&lt;/span&gt; &lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'46937'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2801'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'1'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'7'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'107'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'116'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'2.80111600000e+006'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'7.15624610182e+003'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'3.39270025503e+002'&lt;/span&gt;,&lt;span style="color: rgb(255, 0, 0);"&gt;'01060000000100000001030000000100000005000000C07A13F7207A314160903B487DDB5041803FC859407A3141F018096069DB5041C02DDE73F8793141C0A7E30960DB50410009F5D4D679314140E3658775DB5041C07A13F7207A314160903B487DDB5041'&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;/*&lt;br /&gt;other omitted INSERT statments...&lt;br /&gt;*/&lt;/span&gt;&lt;br /&gt;END;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class="bash"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-3275250004010326098?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/3275250004010326098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=3275250004010326098' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/3275250004010326098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/3275250004010326098'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2009/03/postgis-what-is-postgis-postgis-is.html' title='POSTGIS'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-3564621132488722969</id><published>2009-01-18T23:55:00.000-08:00</published><updated>2009-01-18T23:58:36.700-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview Questions For GIS'/><title type='text'>Interview Questions For GIS</title><content type='html'>&lt;p&gt;1. GIS is a highly technical, cutting edge technology. As a member of the IT community, how do you stay current with changes in GIS and technology?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;2. You have been given a text file consisting of miscellaneous data including names, addresses,  and X-Y coordinates. How would you input this data into a GIS?&lt;/p&gt;&lt;p&gt;3. What is the difference between CAD and GIS? What would an appropriate use be for either?&lt;/p&gt;&lt;p&gt;4. What is a projection? How is a projection changed using ARCINFO or ArcView?&lt;/p&gt;&lt;p&gt;5. How do raster and vector data differ, and give an example of each?&lt;/p&gt;&lt;p&gt;6. How would you copy a file from a network location in a Windows environment?&lt;/p&gt;&lt;p&gt;7. What is Heads-Up Digitizing?&lt;/p&gt;&lt;p&gt;8. What is a variable?&lt;/p&gt;&lt;p&gt;9. What is the difference between a Union and an Intersect function?&lt;/p&gt;&lt;p&gt;10. Given a database with a “Last Name” Field, describe a SQL statement that selects all people with the last name of Smith.&lt;/p&gt;&lt;p&gt;11. What file is required to properly display a TIFF Image in the correct coordinate space?&lt;/p&gt;&lt;p&gt;12. Given a Future Land Use coverage or shapefile, how could you calculate the acreages by Land Use type? Assume that there is a field called “acreage.”&lt;/p&gt;&lt;p&gt;13. A data request for eagle nest locations has been given to you. How do you go about locating the data?&lt;/p&gt;&lt;p&gt;14. How do you set an environment variable in Windows NT, 9x or any programming language?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-3564621132488722969?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/3564621132488722969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=3564621132488722969' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/3564621132488722969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/3564621132488722969'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2009/01/interview-questions-for-gis.html' title='Interview Questions For GIS'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-1441810596914468107</id><published>2008-11-06T23:20:00.000-08:00</published><updated>2008-11-06T23:32:01.605-08:00</updated><title type='text'>Oracle Spatial Queries</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_bYmUFO0qOcs/SRPsqHFK5AI/AAAAAAAAABA/nfovV60eq7E/s1600-h/Spatial+Query+-+Figure.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5265812597525636098" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 270px; CURSOR: hand; HEIGHT: 270px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_bYmUFO0qOcs/SRPsqHFK5AI/AAAAAAAAABA/nfovV60eq7E/s320/Spatial+Query+-+Figure.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Table Creation in Oracle Spatial (DDL Command)&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;&lt;em&gt;CREATE TABLE mylake (    feature_id NUMBER PRIMARY KEY,    name VARCHAR2(32),&lt;br /&gt;    shape MDSYS.SDO_GEOMETRY);&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Insert (DML Command) in Oracle Spatial&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff6666;"&gt;INSERT INTO mylake VALUES(    10, -- feature_id    'Lake Calhoun', -- name    MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1, 19,2003,1),MDSYS.SDO_ORDINATE_ARRAY(0,0, 10,0, 10,10, 0,10, 0,0, 4,4, 6,4, 6,6, 4,6, 4,4)&lt;br /&gt;    ));&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Querying&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff6666;"&gt;SELECT name boat_nameFROM mylake tWHERE feature_id = 12AND SDO_FILTER(t.shape, mdsys.sdo_geometry(2003,NULL,NULL,    mdsys.sdo_elem_info_array(1,1003,1),    mdsys.sdo_ordinate_array(2,2, 5,2, 5,5, 2,5, 2,2)),&lt;br /&gt;    'querytype=WINDOW') = 'TRUE';&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;This query selects all boats that have geometry with an indexed grid square within the polygon defined. This doesn't necessarily mean the returned boats are within the rectangle or if they are just touching the defined rectangle. To obtain an exact query, a second function called SDO_RELATE must be executed. SDO_RELATE looks at two geometries and determines if they interact in a specified way. It is important to note that SDO_RELATE only works on two-dimensional data. It is defined below.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SDO_RELATE(geometry1 MDSYS.SDO_GEOMETRY, geometry2 MDSYS.SDO_GEOMETRY,        params VARCHAR2)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;SDO_RELATE arguments are the same as those for SDO_FILTER with the exception of the last argument. The params argument has a masktype value in addition to the querytype value. The masktype value can take the values listed below.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;DISJOINT&lt;/span&gt; — the boundaries and interiors do not intersect &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;TOUCH&lt;/span&gt; — the boundaries intersect but the interiors do not intersect &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;OVERLAPBDYDISJOINT&lt;/span&gt; — the interior of one object intersects the boundary and interior of the other object, but the two boundaries do not intersect. This relationship occurs, for example, when a line originates outside a polygon and ends inside that polygon. &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;OVERLAPBDYINTERSECT&lt;/span&gt; — the boundaries and interiors of the two objects intersect &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;EQUAL&lt;/span&gt; — the two objects have the same boundary and interior &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;CONTAINS&lt;/span&gt; — the interior and boundary of one object is completely contained in the interior of the other object &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;COVERS&lt;/span&gt; — the interior of one object is completely contained in the interior of the other object and their boundaries intersect &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;INSIDE&lt;/span&gt; — the opposite of CONTAINS. A INSIDE B implies B CONTAINS A. &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;COVEREDBY&lt;/span&gt; — the opposite of COVERS. A COVEREDBY B implies B COVERS A. &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;ON&lt;/span&gt; — the interior and boundary of one object is on the boundary of the other object (and the second object covers the first object). This relationship occurs, for example, when a line is on the boundary of a polygon. &lt;/li&gt;&lt;li&gt;&lt;span style="color:#3366ff;"&gt;ANYINTERACT&lt;/span&gt; — the objects are non-disjoint. &lt;/li&gt;&lt;/ul&gt;To select all boats that are inside a defined rectangle the following query would work: &lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff6666;"&gt;SELECT name boat_nameFROM mylake tWHERE feature_id = 12AND SDO_FILTER(t.shape, mdsys.sdo_geometry(2003,NULL,NULL,    mdsys.sdo_elem_info_array(1,1003,1),    mdsys.sdo_ordinate_array(2,2, 5,2, 5,5, 2,5, 2,2)),    'querytype=WINDOW') = 'TRUE'AND SDO_RELATE(t.shape, mdsys.sdo_geometry(2003,NULL,NULL,    mdsys.sdo_elem_info_array(1,1003,1),    mdsys.sdo_ordinate_array(2,2, 5,2, 5,5, 2,5, 2,2)),    'masktype=INSIDE querytype=WINDOW') = 'TRUE'&lt;/span&gt;  &lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;It is also possible to combine masktypes to select sites that are inside or touching the defined polygon with the query below.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff6666;"&gt;SELECT feature_id idFROM mylake tWHERE feature_id = 12AND SDO_FILTER(t.shape, mdsys.sdo_geometry(2003,NULL,NULL,    mdsys.sdo_elem_info_array(1,1003,1),    mdsys.sdo_ordinate_array(2,2, 5,2, 5,5, 2,5, 2,2)),    'querytype=WINDOW') = 'TRUE'AND SDO_RELATE(t.shape, mdsys.sdo_geometry(2003,NULL,NULL,    mdsys.sdo_elem_info_array(1,1003,1),    mdsys.sdo_ordinate_array(2,2, 5,2, 5,5, 2,5, 2,2)),    'masktype=INSIDE+TOUCH querytype=WINDOW') = 'TRUE' &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-1441810596914468107?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/1441810596914468107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=1441810596914468107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/1441810596914468107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/1441810596914468107'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/11/oracle-spatial-queries.html' title='Oracle Spatial Queries'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_bYmUFO0qOcs/SRPsqHFK5AI/AAAAAAAAABA/nfovV60eq7E/s72-c/Spatial+Query+-+Figure.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-5308132463027221679</id><published>2008-10-22T03:53:00.001-07:00</published><updated>2008-10-22T03:56:29.869-07:00</updated><title type='text'>How to change the default form in windows application in c#.net</title><content type='html'>Go to Program.cs of your application and replace the form name with your form name in Application.Run&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;Application.Run(new MainForm());&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-5308132463027221679?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/5308132463027221679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=5308132463027221679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/5308132463027221679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/5308132463027221679'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/10/how-to-change-default-form-in-windows.html' title='How to change the default form in windows application in c#.net'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-1588436240010739958</id><published>2008-10-22T03:34:00.000-07:00</published><updated>2008-10-22T03:52:23.038-07:00</updated><title type='text'>How to fill the datagrid with the data from database using datasets</title><content type='html'>1. Make connection String and selection statement &lt;br /&gt;SqlConnection conn = new SqlConnection(@"Data Source=192.125.5.1;Initial Catalog=Test;User ID=sa;Password=sa;");&lt;br /&gt;string getCommand = @"select * from dbo.compDetails";&lt;br /&gt;&lt;br /&gt;2. Declare the object of command &amp;amp; give the respective parameters&lt;br /&gt;//give selection statement&lt;br /&gt;SqlCommand cmd = new SqlCommand(getCommand);&lt;br /&gt;//give the command type&lt;br /&gt;cmd.CommandType = CommandType.Text;&lt;br /&gt;//give connection object&lt;br /&gt;cmd.Connection = conn;&lt;br /&gt;&lt;br /&gt;3. Declare the object of SqlDataAdpater &amp;amp; give command object&lt;br /&gt;SqlDataAdapter da = new SqlDataAdapter(cmd);&lt;br /&gt;&lt;br /&gt;4. Declare the object of dataset as container of data&lt;br /&gt;DataSet ds = new DataSet();&lt;br /&gt;&lt;br /&gt;5. Open the connection&lt;br /&gt;conn.Open();&lt;br /&gt;&lt;br /&gt;6. Fill the object of data Adapter with dataset object&lt;br /&gt;da.Fill(ds, "dbo.complaints");&lt;br /&gt;&lt;br /&gt;7. Provide the dataset object as a source to dataGrid&lt;br /&gt;this.dataGrid1.DataSource = ds.Tables[0];&lt;br /&gt;&lt;br /&gt;8. Close the connection&lt;br /&gt;conn.Close();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;public void getData()&lt;br /&gt;{&lt;br /&gt;SqlConnection conn = new SqlConnection(@"Data Source=192.125.5.1;Initial Catalog=Test;User ID=lrmis;Password=lrmis;");&lt;br /&gt;string getCommand = @"select * from dbo.compDetails";&lt;br /&gt;SqlCommand cmd = new SqlCommand(getCommand);&lt;br /&gt;cmd.CommandType = CommandType.Text;&lt;br /&gt;cmd.Connection = conn;&lt;br /&gt;SqlDataAdapter da = new SqlDataAdapter(cmd);&lt;br /&gt;DataSet ds = new DataSet();&lt;br /&gt;conn.Open();&lt;br /&gt;da.Fill(ds, "dbo.complaints");&lt;br /&gt;this.dataGrid1.DataSource = ds.Tables[0];&lt;br /&gt;conn.Close();&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-1588436240010739958?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/1588436240010739958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=1588436240010739958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/1588436240010739958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/1588436240010739958'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/10/how-to-fill-datagrid-with-data-from.html' title='How to fill the datagrid with the data from database using datasets'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-2561213138724182940</id><published>2008-10-22T02:58:00.000-07:00</published><updated>2008-10-22T03:21:51.359-07:00</updated><title type='text'>How to Insert Data in Database in c#</title><content type='html'>1. First of all make connection string&lt;br /&gt;string connString="Data Source=databasename;Initial Catalog=Test;User ID=sa;Password=sa;"&lt;br /&gt;SqlConnection conn = new SqlConnection(connString);&lt;br /&gt;&lt;br /&gt;2. Open the connection&lt;br /&gt;conn.Open();&lt;br /&gt;&lt;br /&gt;3. Write the insert command&lt;br /&gt;string insertCommand= @"insert into dbo.compDetails(OwnerId, compName, compAddress, compPhone) values('" + compId + "','" + this.txtCompaName.Text + "','" + this.txtCompAddress.Text + "','" + this.txtCompPhone.Text + "')";&lt;br /&gt;&lt;br /&gt;SqlCommand cmdInsert = new SqlCommand(insertCommand, conn);&lt;br /&gt;&lt;br /&gt;4. Execute the command&lt;br /&gt;cmdInsert.ExecuteScalar();&lt;br /&gt;&lt;br /&gt;5. Close the connection&lt;br /&gt;conn.Close();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;public void setData()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;string connString="Data Source=databasename;Initial Catalog=Test;User ID=sa;Password=sa;"&lt;br /&gt;SqlConnection conn = new SqlConnection(connString);&lt;br /&gt;conn.Open();&lt;br /&gt;Guid compId = Guid.NewGuid();&lt;br /&gt;string insertCommand= @"insert into dbo.compDetails(OwnerId, compName, compAddress, compPhone) values('" + compId + "','" + this.txtCompaName.Text + "','" + this.txtCompAddress.Text + "','" + this.txtCompPhone.Text + "')";&lt;br /&gt;SqlCommand cmdInsert = new SqlCommand(insertCommand, conn);&lt;br /&gt;cmdInsert.ExecuteScalar();&lt;br /&gt;conn.Close();&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-2561213138724182940?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/2561213138724182940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=2561213138724182940' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/2561213138724182940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/2561213138724182940'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/10/how-to-insert-data-in-database-in-c.html' title='How to Insert Data in Database in c#'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-2665162011891289998</id><published>2008-09-29T19:06:00.000-07:00</published><updated>2008-09-29T19:09:09.940-07:00</updated><title type='text'>.Net Remoting</title><content type='html'>&lt;div align="justify"&gt;While Web services are arguably the best way for clients outside of your organization to access components, what about components within your organization? Many companies are building Web services and using them internally. There is nothing wrong with this approach, but it doesn't provide the best performance. If components are created in .NET and the client applications are .NET, you can place components on shared servers and access them via remoting.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;Remoting is the .NET technology that replaces DCOM allowing you to communicate between a client application and components in a binary format. As a result, remotable components are faster than Web services. However, creating remotable components is more difficult because you must add additional code to your components. This code isn't much more complicated than its Web service counterpart, but you cannot directly instantiate a remote component. Instead, you must create a host application that instantiates the component and listens for requests. The good news is that this host can be a Windows service, a Windows application, a console application, or anything that can run and hold the object open.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;Not only do you have to create a host application, you must also make several decisions about the remotable object, such as which channel to use. .NET supports both HTTP and TCP channels. The HTTP channel actually uses the SOAP protocol to transport messages to and from remotable objects; this means all messages are serialized to XML. The TCP channel uses a binary stream to transport the messages.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;.NET is architected in such a way that remotable components can change channels without being recompiled. You can place the channel information in a configuration file and change from TCP to HTTP or vice versa without recompiling the application. Similarly, you can change a configuration file for the client to match the channel that the host is using.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-2665162011891289998?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/2665162011891289998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=2665162011891289998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/2665162011891289998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/2665162011891289998'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/09/net-remoting.html' title='.Net Remoting'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-1574187309278306543</id><published>2008-09-24T21:49:00.000-07:00</published><updated>2008-09-24T23:13:08.135-07:00</updated><title type='text'>Pakistan Ranks 62nd in Global IT Competitiveness Index</title><content type='html'>&lt;div align="justify"&gt;Pakistan ranks 62nd in the world in the 2008 Information Technology (IT) industry competitiveness index, falling two place; from its 2007 ranking of 60 in the index. In comparison, most neighbouring South Asian countries were ranked more favourably; for example India ranked 48th, Sri Lanka ranked 54th and Bangladesh ranked 60th.These are among the findings of a new study issued by the Economist intelligence Unit and sponsored by the Business Software Alliance (BSA). The study, now in its second year, assesses and compares the IT industry environments of 66 countries to determine the extent to which they enable IT sector competitiveness.Although the top 20 economies remain the same from one year ago, nine countries moved up and 11 went down in the rankings. Three countries in the top five are, new: Taiwan, Sweden and, Denmark. The top five countries in Asia-pacific Region are Taiwan, Australia, South Korea, Singapore and Japan.-PR&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-1574187309278306543?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/1574187309278306543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=1574187309278306543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/1574187309278306543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/1574187309278306543'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/09/pakistan-ranks-62nd-in-global-it.html' title='Pakistan Ranks 62nd in Global IT Competitiveness Index'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-6705061503533349005</id><published>2008-09-23T22:38:00.000-07:00</published><updated>2008-09-24T00:00:37.489-07:00</updated><title type='text'></title><content type='html'>&lt;div align="justify"&gt;&lt;a href="http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnVa-TKmII/AAAAAAAAAAY/4ZGFBJtF69Q/s1600-h/configuration.jpg"&gt;&lt;/a&gt;&lt;strong&gt;Introducing Cache Dependencies:&lt;/strong&gt;&lt;br /&gt;As time passes, the data source may change in response to other actions. However, if your code uses caching, you may remain unaware of the changes and continue using out-of-date information from the cache. To help mitigate this problem, ASP.NET supports cache dependencies. Cache dependencies allow you to make a cached item dependent on another resource so that when that resource changes the cached item is removed automatically. ASP.NET includes three types of dependencies:&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;Dependencies on other cache items. &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Dependencies on files or folders. &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Dependencies on a database query. &lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="justify"&gt;&lt;strong&gt;Cache Notifications in SQL Server 2000:&lt;br /&gt;&lt;/strong&gt;Before you can use SQL Server cache invalidation, you need to enable notifications for the database. This task is performed with the &lt;strong&gt;aspnet_regsql.exe&lt;/strong&gt; command-line utility, which is located in the c:\[WinDir]\Microsoft.NET\Framework\[Version] directory. To enable notifications, you need to use the &lt;strong&gt;-ed&lt;/strong&gt; command-line switch. You also need to identify the server (use &lt;strong&gt;-E&lt;/strong&gt; for a trusted connection and &lt;strong&gt;-S&lt;/strong&gt; to choose a server other than the current computer) and the database (use&lt;strong&gt; -d&lt;/strong&gt;). Here's an example that enables notifications for the &lt;strong&gt;Northwind&lt;/strong&gt; database on the current server:&lt;/div&gt;&lt;div&gt;&lt;strong&gt;aspnet_regsql -ed -E -d&lt;/strong&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div align="justify"&gt;NorthwindAfter executing this command, a new table named &lt;strong&gt;SqlCacheTablesForChangeNotification&lt;/strong&gt; is added to the database Northwind. The &lt;strong&gt;SqlCacheTablesForChangeNotification&lt;/strong&gt; table has three columns: tableName, notificationCreated, and changeId. This table is used to track changes. Essentially, when a change takes place, a record is written into this table. The SQL Server polling queries this table. Also a set of stored procedures is added to the database.&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;How Notificaions Works:&lt;/strong&gt;&lt;br /&gt;The AspNet_SqlCacheTablesForChangeNotification contains a single record for every table you're monitoring. When you make a change in the table (such as inserting ,deleting or updating a record), the changeId column is incremented by 1 -see AspNet_SqlCacheUpdateChangeIdStoredProcedure procedure-. ASP.NET queries this table repeatedly and keeps track of the most recent changeId values for every table. When this value changes in a subsequent read, ASP.NET knows that the table has changed.&lt;/div&gt;&lt;div align="justify"&gt;In this scenario, Any change to the table is deemed to invalidate any query for that table. In other words, if you use this query: &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;SELECT * FROM Products WHERE CategoryID=1&lt;/strong&gt;&lt;/div&gt;&lt;p align="justify"&gt;The caching still works in the same way. That means if any product record is touched, even if the product resides in another category (and therefore isn't one of the cached records), the notification is still sent and the cached item is considered invalid. Also keep in mind it doesn't make sense to cache tables that change frequently.&lt;/p&gt;&lt;div align="justify"&gt;&lt;strong&gt;Enable ASP.Net Polling:&lt;br /&gt;&lt;/strong&gt;To enable ASP.NET polling , you need to use the &lt;strong&gt;&lt;sqlcachedepency&gt;&lt;/strong&gt;element in the web.config file. Set the enabled attribute to true to turn it on, and set the pollTime attribute to the number of milliseconds between each poll. (The higher the poll time, the longer the potential delay before a change is detected.) You also need to supply the connection string information.&lt;a href="http://3.bp.blogspot.com/_bYmUFO0qOcs/SNnkhv6VAlI/AAAAAAAAAAg/fP0L5LhHpdg/s1600-h/configuration.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5249478109124952658" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_bYmUFO0qOcs/SNnkhv6VAlI/AAAAAAAAAAg/fP0L5LhHpdg/s320/configuration.jpg" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Creating the Cache Dependency:&lt;/strong&gt;&lt;br /&gt;Now that we've seen how to set up a database to support SQL Server notifications, the only remaining detail is the code, which is quite straightforward. We can use our cache dependency with programmatic data caching, a data source control, and output caching.&lt;br /&gt;For programmatic data caching, we need to create a new SqlCacheDependency and supply that to the Cache.Insert() method. In the SqlCacheDependency constructor, you supply two strings. The first is the name of the database you defined in the element in the section of the web.config file e.g: Northwind. The second is the name of the linked table e.g: Products.Example:private static void CacheProductsList(List&lt;nwproductitem&gt; products){&lt;br /&gt;SqlCacheDependency sqlDependency = new SqlCacheDependency("Northwind", "Products");HttpContext.Current.Cache.Insert("ProductsList", products, sqlDependency, DateTime.Now.AddDays(1), Cache.NoSlidingExpiration);&lt;br /&gt;}&lt;br /&gt;private static List&lt;nwproductitem&gt; GetCachedProductList(){&lt;br /&gt;return HttpContext.Current.Cache["ProductsList"] as List&lt;nwproductitem&gt;;&lt;br /&gt;}&lt;br /&gt;NWProductItem is business class, and here we are trying to cache a list of NWProductItem instead of DataSet or DataTable.The following method is used by an ObjectDataSource Control to retrieve List of Products&lt;br /&gt;public static List&lt;nwproductitem&gt; GetProductsList(int catId, string sortBy){&lt;br /&gt;//Try to Get Products List from the CacheList&lt;nwproductitem&gt; products = GetCachedProductList();if (products == null){&lt;br /&gt;//Products List not in the cache, so we need to query the Database by using a Data LayerNWProductsDB db = new NWProductsDB(_connectionString);DbDataReader reader = null;products = new List&lt;nwproductitem&gt;(80);&lt;br /&gt;if (catId &gt; 0){&lt;br /&gt;//Return Product List from the Data Layerreader = db.GetProductsList(catId);&lt;br /&gt;}else{&lt;br /&gt;//Return Product List from the Data Layerreader = db.GetProductsList();&lt;br /&gt;}//Create List of Products -List if NWProductItem-products = BuildProductsList(reader);reader.Close();//Add entry to products list in the CacheCacheProductsList(products);&lt;br /&gt;}products.Sort(new NWProductItemComparer(sortBy));if (sortBy.Contains("DESC")) products.Reverse();return products;&lt;br /&gt;}&lt;br /&gt;To perform the same trick with output caching, you simply need to set the SqlDependency property with the database dependency name and the table name, separated by a colon:          &lt;strong&gt;&lt;%@ OutputCache Duration="600" SqlDependency="Northwind:Products" VaryByParam="none" %&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;%@ OutputCache Duration="600" SqlDependency="Northwind:Products" VaryByParam="none" %&gt;The same technique works with the SqlDataSource and ObjectDataSource controls: &lt;strong&gt;&lt;asp:sqldatasource enablecaching="True" sqlcachedependency="Northwind:Products"&gt;&lt;?xml:namespace prefix = asp /&gt;&lt;asp:sqldatasource enablecaching="True" sqlcachedependency="Northwind:Products"&gt;&lt;/asp:sqldatasource&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-6705061503533349005?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/6705061503533349005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=6705061503533349005' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/6705061503533349005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/6705061503533349005'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/09/introducing-cache-dependencies-as-time.html' title=''/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bYmUFO0qOcs/SNnkhv6VAlI/AAAAAAAAAAg/fP0L5LhHpdg/s72-c/configuration.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-4495259649115528657</id><published>2008-09-22T23:28:00.000-07:00</published><updated>2008-09-22T23:40:09.679-07:00</updated><title type='text'>ASP.NET Impersonation</title><content type='html'>&lt;div align="justify"&gt;Another important security feature is the ability to control the identity under which code is executed. Impersonation is when ASP.NET executes code in the context of an authenticated and authorized client. By default, ASP.NET does not use impersonation and instead executes all code using the same user account as the ASP.NET process, which is typically the ASPNET account. &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;This is contrary to the default behavior of ASP, which uses impersonation by default. In Internet Information Services (IIS) 6, the default identity is the NetworkService account.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;Note&lt;/strong&gt;   Impersonation can significantly affect performance and scaling. It is generally more expensive to impersonate a client on a call than to make the call directly.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;Using impersonation, ASP.NET applications can optionally execute the processing thread using the identity of the client on whose behalf they are operating. You usually use impersonation for resource access control. Delegation is a more powerful form of impersonation and makes it possible for the server process to access remote resources while acting as the client.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;If you enable impersonation, ASP.NET can either impersonate the authenticated identity received from IIS or one specified in the application's Web.config file. You have the following three options when configuring impersonation:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;strong&gt;Impersonation is disabled.&lt;/strong&gt; This is the default setting. For backward compatibility with ASP, you must enable impersonation and change the ASP.NET process identity to use the Local System account. In this instance, the ASP.NET thread runs using the process token of the application worker process regardless of which combination of IIS and ASP.NET authentication is used. By default, the process identity of the application worker process is the ASPNET account.  &lt;strong&gt;&lt;identity impersonate="false"&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Impersonation enabled.&lt;/strong&gt; In this instance, ASP.NET impersonates the token passed to it by IIS, which is either an authenticated user or the anonymous Internet user account (IUSR_machinename). &lt;strong&gt;&lt;identity impersonate="true"&gt;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Impersonation enabled for a specific identity.&lt;/strong&gt; In this instance, ASP.NET impersonates the token generated using an identity specified in the Web.config file. &lt;strong&gt;&lt;identity impersonate="true"&lt;br /&gt;userName="domain\user"&lt;br /&gt;password="password" /&gt;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align="justify"&gt;If the application resides on a UNC share, ASP.NET always impersonates the IIS UNC token to access that share unless a configured account is used. If you provide an explicitly configured account, ASP.NET uses that account in preference to the IIS UNC token.&lt;br /&gt;You should exercise care when using impersonation because it makes it possible for an application to potentially process code using permissions not anticipated by the application designer. For example, if your application impersonates an authenticated intranet user, that application possesses administrative privileges when impersonating a user with those privileges. Likewise, if the impersonated user possesses more restrictive permissions than anticipated, the user may not be able to use the application.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-4495259649115528657?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/4495259649115528657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=4495259649115528657' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/4495259649115528657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/4495259649115528657'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/09/aspnet-impersonation.html' title='ASP.NET Impersonation'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6354706590059817737.post-3024643605582688861</id><published>2008-09-22T23:01:00.000-07:00</published><updated>2008-09-22T23:11:11.360-07:00</updated><title type='text'>Delegates in C#.Net</title><content type='html'>A delegate is a type-safe object that can point to another method (or possibly multiple methods) in the application, which can be invoked at later time.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;A delegate type maintains three important pices of information :&lt;br /&gt;1. The name of the method on which it make calls.&lt;br /&gt;2. Any argument (if any) of this method.&lt;br /&gt;3. The return value (if any) of this method.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;when you want to create a delegate in C# you make use of delegate keyword.The name of your delegate can be whatever you desire. However, you must define the delegate to match the signature of the method it will point to. fo example the following delegate can point to any method taking two integers and returning an integer.public delegate int DelegateName(int x, int y);A Delegate Usage Example&lt;br /&gt;namespace MyFirstDelegate&lt;br /&gt;{&lt;br /&gt;    //This delegate can point to any method,&lt;br /&gt;    //taking two integers and returning an&lt;br /&gt;    //integer.&lt;br /&gt;    public delegate int MyDelegate(int x, int y);&lt;br /&gt;    //This class contains methods that MyDelegate will point to.&lt;br /&gt;    public class MyClass&lt;br /&gt;    {&lt;br /&gt;        public static int Add(int x, int y)&lt;br /&gt;        {&lt;br /&gt;            return x + y;&lt;br /&gt;        }&lt;br /&gt;        public static int Multiply(int x, int y)&lt;br /&gt;        {&lt;br /&gt;            return x * y;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            //Create an Instance of MyDelegate&lt;br /&gt;            //that points to MyClass.Add().&lt;br /&gt;            MyDelegate del1 = new MyDelegate(MyClass.Add);&lt;br /&gt;            //Invoke Add() method using the delegate.&lt;br /&gt;            int addResult = del1(5, 5);&lt;br /&gt;            Console.WriteLine("5 + 5 = {0}\n", addResult);&lt;br /&gt;            //Create an Instance of MyDelegate&lt;br /&gt;            //that points to MyClass.Multiply().&lt;br /&gt;            MyDelegate del2 = new MyDelegate(MyClass.Multiply);&lt;br /&gt;            //Invoke Multiply() method using the delegate.&lt;br /&gt;            int multiplyResult = del2(5, 5);&lt;br /&gt;            Console.WriteLine("5 X 5 = {0}", multiplyResult);&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;        }&lt;br /&gt;    }}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6354706590059817737-3024643605582688861?l=sharpminders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpminders.blogspot.com/feeds/3024643605582688861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6354706590059817737&amp;postID=3024643605582688861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/3024643605582688861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6354706590059817737/posts/default/3024643605582688861'/><link rel='alternate' type='text/html' href='http://sharpminders.blogspot.com/2008/09/delegates-in-cnet.html' title='Delegates in C#.Net'/><author><name>Zahid Z. Malik</name><uri>http://www.blogger.com/profile/11658820342420952443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_bYmUFO0qOcs/SNnmoG2hVrI/AAAAAAAAAAo/n1CrJ1cjcQk/S220/zahid-zubair.jpg'/></author><thr:total>0</thr:total></entry></feed>
