<?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-1142861234663060713</id><updated>2011-11-27T15:43:22.914-08:00</updated><category term='ASP.NET 4.0'/><category term='Smart Devices'/><category term='document.getElementByTagName'/><category term='DataGridView'/><category term='Microsoft Tech ED 2009'/><category term='TechEd 2009 India'/><category term='Export to .csv file'/><category term='System.Management'/><category term='VB.NET'/><category term='Announcement'/><category term='Visual Studio 2010'/><category term='All Sundays in a Year'/><category term='ASP.NET'/><category term='Controls In DataGridView'/><category term='Sync Services'/><category term='Tab Control in ASP.NET'/><category term='Outlook Contacts'/><category term='Save Images Access Database'/><category term='ComboBox in DataGridView'/><category term='C# .NET'/><category term='SMOs'/><category term='News'/><category term='LINQDataSource'/><category term='Number of Characters Word'/><category term='.NET Comact Framework'/><category term='Windows Applicaton'/><category term='All TextBoxes'/><category term='Logging .NET C# windows'/><category term='Save Images into Database'/><category term='jQuery'/><category term='Reports'/><category term='SQL CE 3.5'/><category term='QueryExtender Control'/><category term='Web 2.0'/><category term='IsNumeric in C#'/><category term='Kobe'/><category term='C#'/><category term='SQL Server Management Objects'/><category term='Export to Excel DataGridView ASP.NET'/><category term='ClientSide AJAX ASP.NET 4.0'/><category term='Bing'/><category term='ASP.NET AJAX 3.5 Example'/><category term='Reading ini File VB.NET'/><category term='Validate JavaScript'/><category term='Microsoft New Search Engine'/><category term='ASP.NET HttpWebRequest HttpWebResponse'/><category term='.sdf files'/><category term='Get all Logical Drives'/><category term='.NET Windows Application'/><category term='DirectoryInfo'/><category term='SQL Server Compact 3.5 Sync Services'/><category term='Show ComboBox Full Item Text'/><category term='EntityDataSource'/><category term='Dynamic Controls'/><category term='MulitiView Control'/><category term='.NET'/><title type='text'>.NET Developer's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>43</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5986603044506076932</id><published>2009-07-21T10:46:00.001-07:00</published><updated>2009-07-21T10:46:20.680-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LINQDataSource'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 4.0'/><title type='text'>LINQ DataSource Insert, Update and Delete : ASP.NET 4.0</title><content type='html'>&lt;p&gt;Its been some time I didn’t write any thing on the blog, I was busy with my projects, so now thought of writing some thing on LINQ Datasource in ASP.NET .NET 4.0 (also part of .NET v3.5).&lt;/p&gt;  &lt;p&gt;In this example I am trying to display list of products in a GridView and Insert, Update and Delete products using LINQ Datasource, so lets start building the application.&lt;/p&gt;  &lt;p&gt;Create a new Web Application Project in Visual Studio and add one GridView and LINQ DataSource to Default.aspx, before we configure LINQ data source we need a LINQ to SQL Class so add a new file to project and select LINQ to SQL class file.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SmX-Rh8ynlI/AAAAAAAABNc/WX4yyvwWIuU/s1600-h/LINQToSQL%5B3%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="LINQToSQL" border="0" alt="LINQToSQL" src="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-TPvn4CI/AAAAAAAABNg/kjLnyRZLshs/LINQToSQL_thumb%5B1%5D.jpg?imgmax=800" width="518" height="372" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once this file is added project we need to select data from data base, for this open the server explorer and Drag and drop Products, Supplier and Category Tables to this file, please refer below screen shot.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-ULTD8jI/AAAAAAAABNk/OF9wqfbxo0E/s1600-h/LINQToSQL1%5B3%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="LINQToSQL1" border="0" alt="LINQToSQL1" src="http://lh6.ggpht.com/_eknxl1DkWrU/SmX-XTHnh9I/AAAAAAAABNo/jgpusViywxw/LINQToSQL1_thumb%5B1%5D.jpg?imgmax=800" width="528" height="325" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we have successfully created LINQ SQL class with our required entities, to reflect these changes to project we need build project once here.&lt;/p&gt;  &lt;p&gt;Now open Default.aspx and select LINQDataSource1 controls and click ‘&amp;gt;’ symbol to configure the datasource, once you click on that symbol you will be asked to select the Entity class, as we have already created our LINQ to SQL class you can select that from the combo box&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SmX-YQIpDhI/AAAAAAAABNs/d9ICjWL3aI4/s1600-h/ConfigureLINQ1%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ConfigureLINQ1" border="0" alt="ConfigureLINQ1" src="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-Zoq90UI/AAAAAAAABNw/IZMMgpOIV5w/ConfigureLINQ1_thumb%5B2%5D.jpg?imgmax=800" width="522" height="407" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click on Next to select the actual entity that is products, here we need the option to Select, Update and delete so click on Advance button and select those options.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SmX-bcK8CQI/AAAAAAAABN0/71pDblsFQXI/s1600-h/ConfigureLINQ2%5B3%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ConfigureLINQ2" border="0" alt="ConfigureLINQ2" src="http://lh4.ggpht.com/_eknxl1DkWrU/SmX-c6J7w4I/AAAAAAAABN4/X38FYnqnrRM/ConfigureLINQ2_thumb%5B1%5D.jpg?imgmax=800" width="528" height="412" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once selected click on Ok, and Finish, now our LINQDatasource is bound with data and ready to bind to GridView, so select the GridView and click ‘&amp;gt;’ symbol to configure datasource. Select DataSource as LINQDataSource1 and check the options Enable Editing and Enable Deleting.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SmX-d7u39DI/AAAAAAAABN8/Mg-Y9X4F2xM/s1600-h/ConfigureGridView%5B6%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ConfigureGridView" border="0" alt="ConfigureGridView" src="http://lh3.ggpht.com/_eknxl1DkWrU/SmX-ffy4nrI/AAAAAAAABOA/1xFgyDGYlLg/ConfigureGridView_thumb%5B2%5D.jpg?imgmax=800" width="542" height="239" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our Display products, Edit Products and Delete products you can run the project and check these are working fine.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SmX-g4KJwJI/AAAAAAAABOE/Y9HIpCMdnPU/s1600-h/image%5B8%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SmX-iKBKfsI/AAAAAAAABOI/sQ5cCQ7vDkc/image_thumb%5B4%5D.png?imgmax=800" width="545" height="169" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now we will add a new product for that we need a separate web form where we will add new product, for this add new Web for and name it as AddProduct.aspx, now add 6 TextBoxs, 2 DropDownLists, 2 Buttons and one CheckBox control to this page as show in the below Screen shot, also add 3 LINQDataSource objects to form.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-kIR7ThI/AAAAAAAABOM/-C9Hg9xK6jo/s1600-h/image%5B4%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SmX-l5KzhEI/AAAAAAAABOQ/auEDW3a42Uk/image_thumb%5B2%5D.png?imgmax=800" width="553" height="436" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Here we need 3 LINQDataSource controls because we want to show Categories and Suppliers in combo boxes while creating the product so that user will select the values, so select LinqDataSource1 control and configure select SQL to LINQ class entity and select Suppliers as Table and select only SupplierId and CompanyName fields.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SmX-nO2UPAI/AAAAAAAABOU/IPXCjFCjmHQ/s1600-h/SuppliersLINQ%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SuppliersLINQ" border="0" alt="SuppliersLINQ" src="http://lh6.ggpht.com/_eknxl1DkWrU/SmX-qx9NziI/AAAAAAAABOY/xhXqafiWI7s/SuppliersLINQ_thumb%5B2%5D.jpg?imgmax=800" width="545" height="424" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Similarly select LinqDataSource2 and configure and select Categories Table and select only CategoryId and CategoryName fields from this.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SmX-sdohCyI/AAAAAAAABOc/L5LGDZkmHcU/s1600-h/CategoryLINQ%5B3%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CategoryLINQ" border="0" alt="CategoryLINQ" src="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-tpgJYlI/AAAAAAAABOg/i6gCaYNl5t8/CategoryLINQ_thumb%5B1%5D.jpg?imgmax=800" width="553" height="429" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;These two linq datasources are for displaying the data now we will configure LinqDataSource3 which is for inserting the Product details, so select the LinqDataSource3 and configure select Product table and all fields and select Advanced button and select the option LINQ to perform automatic insert&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-uVQWuII/AAAAAAAABOk/s9r7XNYGHgU/s1600-h/ProductInsertLINQ%5B3%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ProductInsertLINQ" border="0" alt="ProductInsertLINQ" src="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-vT7qD8I/AAAAAAAABOo/zB7niasFt1o/ProductInsertLINQ_thumb%5B1%5D.jpg?imgmax=800" width="540" height="422" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now bind the Category and Supplier data to 2 DropDownLists using LinqDataSource1 and LinqDataSource2.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SmX-w6kGzqI/AAAAAAAABOs/oi3fMJWTFss/s1600-h/image%5B12%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SmX-yCTlteI/AAAAAAAABOw/TxazPGpdCrc/image_thumb%5B6%5D.png?imgmax=800" width="542" height="311" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Similarly for Categories DropDownList, now we have to insert the data into LinqDataSource3 once user enters data and clicks Save button, so we need to write following code in the Save button’s click event&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-ztglW7I/AAAAAAAABO0/Xygi9P8QD_4/s1600-h/AddProductCode%5B3%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="AddProductCode" border="0" alt="AddProductCode" src="http://lh3.ggpht.com/_eknxl1DkWrU/SmX-1aXYsEI/AAAAAAAABO4/WvwnxBBm13E/AddProductCode_thumb%5B1%5D.jpg?imgmax=800" width="549" height="388" /&gt;&lt;/a&gt; In the above code I am creating a ListDictionary object and adding all the values with the Column names and passing that object to Insert method of LinqDatasource after inserting I am redirecting to Default.aspx page.&lt;/p&gt;  &lt;p&gt;So to launch Add Product page we need to add a link on the Default.aspx page and on clicking link redirect to AddProduct.aspx page.&lt;/p&gt;  &lt;p&gt;Now we are ready with our code let build, run and test.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SmX-3CiEhyI/AAAAAAAABO8/4bhDn-C0t5s/s1600-h/image%5B16%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SmX-4iVfpzI/AAAAAAAABPA/a-M8JYfLbt0/image_thumb%5B8%5D.png?imgmax=800" width="555" height="415" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SmX-5vY_a3I/AAAAAAAABPE/5wzlC4lzgBU/s1600-h/image%5B20%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SmX-6vfVFAI/AAAAAAAABPI/UEiYmpPDdJM/image_thumb%5B10%5D.png?imgmax=800" width="563" height="53" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hope this helps &lt;/p&gt;  &lt;p&gt;Tags : LINQDataSource Insert, Update and Delete, ASP.NET 4.0, GridView, LINQ&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5986603044506076932?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5986603044506076932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/07/linq-datasource-insert-update-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5986603044506076932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5986603044506076932'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/07/linq-datasource-insert-update-and.html' title='LINQ DataSource Insert, Update and Delete : ASP.NET 4.0'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_eknxl1DkWrU/SmX-TPvn4CI/AAAAAAAABNg/kjLnyRZLshs/s72-c/LINQToSQL_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-6394522514344501705</id><published>2009-06-14T00:03:00.001-07:00</published><updated>2009-06-14T00:03:06.727-07:00</updated><title type='text'>Storing Files In Database Using ASP.NET</title><content type='html'>&lt;p&gt;In this example I am storing files like word document, text file and excel files into database and retrieving back from database and saving back into a folder.&lt;/p&gt;  &lt;p&gt;So lets start creating a Table in SQL Server database in which we are going store our uploaded files, in this table I am creating following columns.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;DocumentID int primary key Identity yes &lt;/li&gt;    &lt;li&gt;DocumentName varchar(100) name of the document with extension &lt;/li&gt;    &lt;li&gt;Document varbinary(MAX) binary column for saving file in Binary format. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Open SQL Server Management Studio and open Northwind database and run following script for creating Table&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SjSgHOCCVVI/AAAAAAAABLc/vNTZBGrD-4g/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SjSgOCIFWzI/AAAAAAAABLg/asFFvtzJzNI/image_thumb%5B1%5D.png?imgmax=800" width="491" height="314" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our Database creation so lets create a web application &lt;/p&gt;  &lt;p&gt;Open Visual Studio and create a Web Application and in Default.aspx add following controls.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;One upload control &lt;/li&gt;    &lt;li&gt;One Button for uploading &lt;/li&gt;    &lt;li&gt;One DropDownList for displaying List of files which are in database already &lt;/li&gt;    &lt;li&gt;One Button for opening selected document. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Please refer following screen shot for design.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SjSgQ4WY8TI/AAAAAAAABLk/xbDOmrffiCg/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SjSgS4YhTcI/AAAAAAAABLo/7fgVS6jz6a0/image_thumb%5B3%5D.png?imgmax=800" width="505" height="294" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In Page_Load event we have to retrieve all documents which are already stored in database before so I have written a method called FillDropDown to fill the DropDownList&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SjSgUSN0YcI/AAAAAAAABLs/_ZRxzGBBAOM/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SjSgaX1jwPI/AAAAAAAABLw/A1osUFnXFkw/image_thumb%5B5%5D.png?imgmax=800" width="505" height="380" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once user selected a file to upload and click on Upload button we have to store that file in database in Binary format so I am using InputStream of uploaded file and reading into byte array and connection to database and storing the data.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SjSgdeaY2XI/AAAAAAAABL0/3xn-f7NK-Vg/s1600-h/image%5B16%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SjSgfr2LFWI/AAAAAAAABL4/hq93mmZmvgQ/image_thumb%5B8%5D.png?imgmax=800" width="498" height="496" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once user selects one uploaded file click on open I am retrieving the binary data of that file from database and using FileStream object I am saving the a folder, I am created a Folder called Documents in the solution itself and storing files in that folder, if a file already present in the folder it will be over written. please add following code in open button click event.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SjSghWnRBRI/AAAAAAAABL8/0QOI9I_lM0g/s1600-h/image%5B24%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SjSgj8sHGgI/AAAAAAAABMA/AEXfzF7PFn4/image_thumb%5B12%5D.png?imgmax=800" width="500" height="585" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;Now we are ready with our code just build, run and test.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SjSglsG6ODI/AAAAAAAABME/BG2KjfiKUJQ/s1600-h/image%5B28%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SjSgqJlHn3I/AAAAAAAABMI/BUfOF8RFV_w/image_thumb%5B14%5D.png?imgmax=800" width="502" height="407" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Tags : Storing files into database, ASP.NET, C#, Web Application, FileStream, InputStream.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-6394522514344501705?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/6394522514344501705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/storing-files-in-database-using-aspnet.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6394522514344501705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6394522514344501705'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/storing-files-in-database-using-aspnet.html' title='Storing Files In Database Using ASP.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eknxl1DkWrU/SjSgOCIFWzI/AAAAAAAABLg/asFFvtzJzNI/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-608247396183794179</id><published>2009-06-13T22:54:00.001-07:00</published><updated>2009-06-13T22:54:27.651-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Show ComboBox Full Item Text'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Applicaton'/><title type='text'>Show Long Text Item in ComboBox</title><content type='html'>&lt;p&gt;Many times in our windows form we need to show data in Combo Box and items in combo box are have same length, so we face a problem that some item in the combo box is not shown fully, and increasing width of then combo might not always the good idea.&lt;/p&gt;  &lt;p&gt;To avoid above mentioned problem we have a solution, we can increase the height of the combo box item at run time based on the length so the item can be read fully, so lets start building the example.&lt;/p&gt;  &lt;p&gt;Open Visual Studio and Create a Windows Form Application and Add One label and one combo box and and some items in the combo box as shown in the below screen shot.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SjSQWy-YTtI/AAAAAAAABK8/DH7fUohxQQU/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SjSQYI4wa1I/AAAAAAAABLA/rIXRZnVtPYQ/image_thumb%5B1%5D.png?imgmax=800" width="503" height="337" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with design part, so lets start writing some code to increase the height of the combo box, for this we need to make use of the MeasureItem event of Combo box, in this item we can find out what is the length of each item and based on the length we can set the height, once you we set the item length we need to add the item in Combo Box using DrawItem event.&lt;/p&gt;  &lt;p&gt;Normally the combo box draw style is OwnerDrawFixed so we cannot change any item at run time if it is OwnerDrawFixed so we need to change Combo Box’s DrawStyle to OwnerDrawVariable so that run time changes are allowed.&lt;/p&gt;  &lt;p&gt;Please add following code in Form_Load, in below code I am setting DrawStyle and assigning MeasureIteam and DrawItem events to Combo Box&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SjSQZZJMTWI/AAAAAAAABLE/0xpQXrj1960/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SjSQa7pQxXI/AAAAAAAABLI/8AsSCQS3NVE/image_thumb%5B3%5D.png?imgmax=800" width="506" height="148" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We need add following event handler for handling MeasureItem and DrawItem events.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SjSQdNqmYwI/AAAAAAAABLM/ZFw_2Utabq0/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SjSQfkZQGII/AAAAAAAABLQ/H1EbjbB-o54/image_thumb%5B5%5D.png?imgmax=800" width="511" height="281" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our code so lets build, run and test.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SjSQhh6nrkI/AAAAAAAABLU/5EBgcswlJ_0/s1600-h/image%5B15%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SjSQktjXxmI/AAAAAAAABLY/nTDe6GWB7yA/image_thumb%5B7%5D.png?imgmax=800" width="331" height="267" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Tags: Showing full item text in Combo Box, .NET, C#, Windows Application&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-608247396183794179?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/608247396183794179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/show-long-text-item-in-combobox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/608247396183794179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/608247396183794179'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/show-long-text-item-in-combobox.html' title='Show Long Text Item in ComboBox'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_eknxl1DkWrU/SjSQYI4wa1I/AAAAAAAABLA/rIXRZnVtPYQ/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-7802130661439412041</id><published>2009-06-08T08:18:00.001-07:00</published><updated>2009-06-08T08:18:44.487-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='ClientSide AJAX ASP.NET 4.0'/><title type='text'>Client Side AJAX in ASP.NET 4.0</title><content type='html'>&lt;p&gt;AJAX is most used technology these days, this avoids page reloads and user will not get frustrated, however it still requires a post back to server so ASP.NET 4.0 introduced ClientSide AJAX which is achieved by using some jQuery and server side service&lt;/p&gt;  &lt;p&gt;Here I am going to build a sample using Northwind database Categories and Products, on selecting a category all products under that category will be listed, to list the products I am using a HTML Table and Templates.&lt;/p&gt;  &lt;p&gt;So lets start, open Visual Studio 2010 and create a Web Application and name it as ClientSideAjax. To retrive the data from database I am using 2 DataSources those are&lt;/p&gt;  &lt;p&gt;1) &lt;strong&gt;SQLDataSource1&lt;/strong&gt; : Just drag and drop a SQLDataSource object from tool box and select connection and connect to Northwind database’s Categories table.&lt;/p&gt;  &lt;p&gt;2) &lt;strong&gt;ProductsCategories.edmx&lt;/strong&gt;: This datasource is EntityDataModel, just right click on project in Solution Explorer and add a new file select EntityDataModel and name it as ProductsCategories.edmx, just follow the steps and connect to Northwind Database and select Product and Categories tables and finish.&lt;/p&gt;  &lt;p&gt;Now we have created required datasources for our project, so let start designing the web form, we need to add one Dropdownlist for listing all the categories and one HTML table for listing all the products under selected category, set the DataSource1 to DropDownlist and set DataTextField = CategoryName and DataValueField = CategoryID&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/Si0rdxRpFSI/AAAAAAAABKM/OZhWdfAH7-k/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Si0rfmAaIuI/AAAAAAAABKQ/f7-ctWlHjbM/image_thumb%5B1%5D.png?imgmax=800" width="498" height="418" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We will talk about {{ ProductName }} template in details below.&lt;/p&gt;  &lt;p&gt;So now lets write a service from where we will get the all the products under a category, for that I added a WebService page Northwind.asmx(create a folder called Services and Northwind service under that folder) and a web method to get products based on category, please find the asmx page in code below I am creating a public web method getProducts, in this method I am reading the data from ProductsCategories EntityDataModel and returning products.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/Si0rh2zNjmI/AAAAAAAABKU/2x2f5Ee5xnU/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/Si0rj-gkyaI/AAAAAAAABKY/u3ply0osWpg/image_thumb%5B3%5D.png?imgmax=800" width="511" height="441" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our server side code and let start write some client side JQuery to read the data from web service and display using JQuery templates. so we need add some Microsoft AJAX JavaScript files to our project just create a folder in our project called MicorsoftAjax and add following files&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Si0rku03dSI/AAAAAAAABKc/DtJP9kA1Kd8/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Si0rouj-hlI/AAAAAAAABKg/q7XsZaOBYxM/image_thumb%5B5%5D.png?imgmax=800" width="530" height="203" /&gt;&lt;/a&gt;&amp;#160; You can download these JavaScript files from &lt;a href="http://aspnet.codeplex.com"&gt;http://aspnet.codeplex.com&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Add reference in the Default.aspx page to all js file and Northwind service, also create a style temple which is used to hide the jQuery template initially&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Si0rp0LTQBI/AAAAAAAABKk/QCQCEI4pmtU/s1600-h/image%5B15%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/Si0rq82HjVI/AAAAAAAABKo/T08rReTAwso/image_thumb%5B7%5D.png?imgmax=800" width="547" height="214" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So now we will write a PageLoad method in JQuery to get the products, now we will add following method to Default.aspx&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/Si0rtpztyxI/AAAAAAAABKs/P3iuenha6Yk/s1600-h/image%5B19%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/Si0rx4nfKJI/AAAAAAAABKw/n_QlMi91SLw/image_thumb%5B9%5D.png?imgmax=800" width="554" height="445" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now we are ready with our code lets build, run and test&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/Si0rzeSK_OI/AAAAAAAABK0/Ennztd_d8TM/s1600-h/image%5B23%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/Si0r0uARneI/AAAAAAAABK4/DcjQMzV19ZE/image_thumb%5B11%5D.png?imgmax=800" width="558" height="435" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;Tags: Client Side AJAX in ASP.NET 4.0, jQuery, Visual Studio 2010, C# .NET&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-7802130661439412041?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/7802130661439412041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/client-side-ajax-in-aspnet-40.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/7802130661439412041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/7802130661439412041'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/client-side-ajax-in-aspnet-40.html' title='Client Side AJAX in ASP.NET 4.0'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eknxl1DkWrU/Si0rfmAaIuI/AAAAAAAABKQ/f7-ctWlHjbM/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-7121942596004959299</id><published>2009-06-04T07:47:00.001-07:00</published><updated>2009-06-10T21:12:05.964-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='QueryExtender Control'/><title type='text'>QueryExtender Web Control : ASP.NET 4.0</title><content type='html'>&lt;p&gt; &lt;/p&gt;&lt;p&gt;Query extender is a new control introduced in ASP.NET 4.0, this control is used to filter and sort data by using different expressions, it has Search Expression, OrderByExpression, RangeExpressions etc. &lt;/p&gt;&lt;p&gt;When you have data in your Datasource and you want to filter at the application end so you always go for this control. &lt;/p&gt;&lt;p&gt;As of now this control is used with LINQDataSource other DataSource controls are not support with Query Extender in Visual Studio 2010 ASP.NET 4.0 beta 1. &lt;/p&gt;&lt;p&gt;I am building a example how we can filter data using QueryExtender, as it is part of ASP.NET 4.0 here I am using Visual Studio 2010 beta 1 so lets start. &lt;/p&gt;&lt;p&gt;Create a web application and Name it as QueryExtender, now we will add a LINQ To SQL Class file to our project by right clicking the project in Solution Explorer selecting Data and Select LINQ to SQL Class file and name it as LINQProducts.dbml, this is the LINQ DataSource for LINQDataSource. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SifeEzTBS8I/AAAAAAAABIg/TdpTZc9c_V0/s1600-h/AddLINQ%5B3%5D.jpg"&gt;&lt;img title="AddLINQ" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="356" alt="AddLINQ" src="http://lh4.ggpht.com/_eknxl1DkWrU/SifeFyN1RyI/AAAAAAAABIk/-vID6AZ98XU/AddLINQ_thumb%5B1%5D.jpg?imgmax=800" width="492" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Once you add this file to our project you can see LINQProducts.dbml file and you will observer 2 parts in the file, now you need to drag and drop your table from Server explorer to right side part, here I am selecting Northwind database's Products table and dropping.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SifeHL8XO8I/AAAAAAAABIo/leG444Ff2_I/s1600-h/CreateLINQ%5B3%5D.jpg"&gt;&lt;img title="CreateLINQ" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="372" alt="CreateLINQ" src="http://lh3.ggpht.com/_eknxl1DkWrU/SifeIcaqiEI/AAAAAAAABIs/KUxfg89hpEc/CreateLINQ_thumb%5B1%5D.jpg?imgmax=800" width="494" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;To effect the changes we need to build our project here once. &lt;/p&gt;&lt;p&gt;Now we have created LINQ source for LINQDataSource control, Now open the design view of Default.aspx page and Add LINQDataSource Control from the Toolbox. &lt;/p&gt;&lt;p&gt;Once you have added the LINQDataSource control select the control and click on '&amp;gt;' symbol and click on Configure DataSource, now you will see a wizard for configuring the datasource, select the 'Show only DataContext objects' check box and choose the LINQProductsDataContext from Context combo box, click on next. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SifeKOtu2kI/AAAAAAAABIw/VAKoT5vk9sQ/s1600-h/LINQControl1%5B4%5D.jpg"&gt;&lt;img title="LINQControl1" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="380" alt="LINQControl1" src="http://lh3.ggpht.com/_eknxl1DkWrU/SifeLiUNZNI/AAAAAAAABI0/owM_41LZ3iQ/LINQControl1_thumb%5B2%5D.jpg?imgmax=800" width="505" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Now choose required fields to display, here I am selecting ProductId, ProductName, UnitPrice, UnitsInStock fields to display and click finish. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SifeNkjfZoI/AAAAAAAABI4/2hhEkLu-m9U/s1600-h/LINQControl2%5B3%5D.jpg"&gt;&lt;img title="LINQControl2" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="382" alt="LINQControl2" src="http://lh4.ggpht.com/_eknxl1DkWrU/SifeP-S9Y5I/AAAAAAAABJA/uh46iyJ5WMQ/LINQControl2_thumb%5B1%5D.jpg?imgmax=800" width="508" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Now we have creaetd LINQDataSource object and bind the data with Products table to display, now drag and drop GridView control from tool box and add to Default.aspx, and '&amp;gt;' and click on Configure DataSource and select LINQDataSouce1 as datasource and Save.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SifeRX8Ln1I/AAAAAAAABJE/AkEBugFr2ls/s1600-h/GridView%5B3%5D.jpg"&gt;&lt;img title="GridView" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="387" alt="GridView" src="http://lh3.ggpht.com/_eknxl1DkWrU/SifeTGf3t9I/AAAAAAAABJI/tOi-8tCzXu8/GridView_thumb%5B1%5D.jpg?imgmax=800" width="515" border="0" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;To check whether data is getting display or not just run the project and see the output .&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SifeUcAFhyI/AAAAAAAABJM/ZSH1QjUTO0M/s1600-h/OutPut1%5B3%5D.jpg"&gt;&lt;img title="OutPut1" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="389" alt="OutPut1" src="http://lh3.ggpht.com/_eknxl1DkWrU/SifeVjhx3dI/AAAAAAAABJQ/1lr23v_Rw_o/OutPut1_thumb%5B1%5D.jpg?imgmax=800" width="517" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;By this point we have displayed the data using LINQDataSource control to filter the data displayed we will use QueryExtender control, before creating the QueryExtender we need to add a reference in Web.Config to make use of its Expressions, so please add following in Pages -&amp;gt; Control section in Web.Config&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SifeXZ3WU4I/AAAAAAAABJU/A-37lxOpNz8/s1600-h/image%5B3%5D.png"&gt;&lt;img title="image" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="110" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SifeYRVfPzI/AAAAAAAABJY/dQ6ZcqGNkcM/image_thumb%5B1%5D.png?imgmax=800" width="521" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Note : In above line you need to replace the PublicKeyToken value with other controls PublicKeyToken.&lt;br /&gt;Once you have done this we are now ready to add QueryExtender to our project just add following code in our Default.aspx page, before adding we need to add some control to our form for search purpose, so add one label and textbox and a button to Default.aspx as shown in the screen shot Design.jpg&lt;/p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SifeZoffXeI/AAAAAAAABJc/jwycX3tg78E/s1600-h/Design%5B3%5D.jpg"&gt;&lt;img title="Design" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="388" alt="Design" src="http://lh3.ggpht.com/_eknxl1DkWrU/Sifeawdc-5I/AAAAAAAABJg/1trI4q2cr6Y/Design_thumb%5B1%5D.jpg?imgmax=800" width="516" border="0" /&gt;&lt;/a&gt; &lt;p&gt;Now add QueryExtender control to Default.aspx&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Sifecc_31ZI/AAAAAAAABJk/elhUlEnHNKg/s1600-h/QueryExtender%5B3%5D.jpg"&gt;&lt;img title="QueryExtender" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="383" alt="QueryExtender" src="http://lh5.ggpht.com/_eknxl1DkWrU/Sifed6neYZI/AAAAAAAABJo/D0bm5arFM6g/QueryExtender_thumb%5B1%5D.jpg?imgmax=800" width="509" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;In the above lines I am creating a QueryExtender and assigning its taget control as our LINQDataSource1, for filtering I am getting the value from a text box, you can also get the result in order by using OrderByExpression.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Now we are ready with our code so let build, run and test &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Sifefkb5ekI/AAAAAAAABJs/_SXUaAbnV4I/s1600-h/OutPut2%5B5%5D.jpg"&gt;&lt;img title="OutPut2" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="395" alt="OutPut2" src="http://lh5.ggpht.com/_eknxl1DkWrU/SifehRV8-rI/AAAAAAAABJw/kuDwuDM4NxY/OutPut2_thumb%5B3%5D.jpg?imgmax=800" width="526" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hope this helps.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-7121942596004959299?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/7121942596004959299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/queryextender-web-control-aspnet-40.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/7121942596004959299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/7121942596004959299'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/queryextender-web-control-aspnet-40.html' title='QueryExtender Web Control : ASP.NET 4.0'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eknxl1DkWrU/SifeFyN1RyI/AAAAAAAABIk/-vID6AZ98XU/s72-c/AddLINQ_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-4186258243329656203</id><published>2009-06-03T11:32:00.001-07:00</published><updated>2009-06-03T11:32:17.703-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EntityDataSource'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><title type='text'>EntityDataSource Control ASP.NET</title><content type='html'>&lt;p&gt;ASP.NET 3.5 sp1 introduces a data source control called EntityDataSource using this control we can bind data to different Data Binding controls.&lt;/p&gt;  &lt;p&gt;Now lets start building an example application which gets the data from Northwind database employee table.&lt;/p&gt;  &lt;p&gt;Open Visual Studio 2008/2010 and create a Web Application.&lt;/p&gt;  &lt;p&gt;Now right click on Solution explorer and add new item and select ADO.NET Entity Data Model and name it as Employees, we will fill EntityDataSource object using this model only.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SibBYJj4uPI/AAAAAAAABHY/P8zbT267LQo/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SibBZWF9YsI/AAAAAAAABHc/I3JXTHAQspQ/image_thumb%5B1%5D.png?imgmax=800" width="447" height="295" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Select the option generate from database and click next&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SibBarFR9LI/AAAAAAAABHg/fwTJ1-iy4fk/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SibBb0mxE1I/AAAAAAAABHk/U3jJy7hYGP0/image_thumb%5B3%5D.png?imgmax=800" width="460" height="407" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now click on the New Connection button and give required details and create a connection to Northwind Database and click next&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SibBdIqsImI/AAAAAAAABHo/F6c46dx11gA/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SibBepZJleI/AAAAAAAABHs/Au5bjYbMevs/image_thumb%5B5%5D.png?imgmax=800" width="472" height="421" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Once you have connected to database it list all the table procedures etc, here I would like to display data of Employee Table so I selected Employee table and click on finish.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SibBfvkFegI/AAAAAAAABHw/7XPsTa8YU1E/s1600-h/image%5B15%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SibBg-ZRXqI/AAAAAAAABH0/anyJOY_ODhA/image_thumb%5B7%5D.png?imgmax=800" width="485" height="433" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our model once you have done this, in you project you will Employees.edmx file&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SibBi63JgiI/AAAAAAAABH4/J9E_eXZiUwU/s1600-h/image%5B18%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SibBj7eA5xI/AAAAAAAABH8/xQ5g2s9LsCE/image_thumb%5B8%5D.png?imgmax=800" width="202" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;to use our model we need to build our project and check whether there are any error or not, just build the project once.&lt;/p&gt;  &lt;p&gt;Our model is ready now, so lets bind the data to a EntityDataSource control for that we need to select a EntityDataSource control from ToolBox and add to Default.aspx, and also add one GridView control to Default.aspx&lt;/p&gt;  &lt;p&gt;To bind the model to our EntityDatasource control just select the control and click on &lt;strong&gt;&amp;gt;&lt;/strong&gt; symbol and select configure.&lt;/p&gt;  &lt;p&gt;Select Named Connection combo box and select our EntityModel, click on next&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SibBk0nMhnI/AAAAAAAABIA/463YKj4rvvc/s1600-h/image%5B28%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SibBmAzw-zI/AAAAAAAABIE/gCstcZ72lEo/image_thumb%5B12%5D.png?imgmax=800" width="464" height="286" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Select EntitySet name as employees, you will see only one employee table because while creating model we have selected only one table if select more those tables also will be listed, one you select employees all the columns of that table will be listed below select which are appropriate to you here I am selected EmpId, first name and last name and finsh&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SibBnGQgv9I/AAAAAAAABII/SvxCfqGy1oc/s1600-h/image%5B32%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SibBoMythKI/AAAAAAAABIM/ene4TTtOkYs/image_thumb%5B14%5D.png?imgmax=800" width="462" height="375" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are created EntityDataSource lets bind the data to grid view for that select the grid view and click on ‘&amp;gt;’ symbol and select EntityDataSource1 as data source.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SibBpDW_IDI/AAAAAAAABIQ/gtPNLjGbU7E/s1600-h/image%5B36%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SibBqEBpVHI/AAAAAAAABIU/6FKkLUpPD2Y/image_thumb%5B16%5D.png?imgmax=800" width="467" height="340" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our code just build, run and test.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SibBrLi7a5I/AAAAAAAABIY/QuS-DYPWelQ/s1600-h/image%5B40%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SibBsA2Dq-I/AAAAAAAABIc/y03r_E7wvy8/image_thumb%5B18%5D.png?imgmax=800" width="477" height="363" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;tags: Using EntityDataSource Control, EntityDataModel, ASP.NET 3.5, ADO.NET &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-4186258243329656203?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/4186258243329656203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/entitydatasource-control-aspnet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/4186258243329656203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/4186258243329656203'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/entitydatasource-control-aspnet.html' title='EntityDataSource Control ASP.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_eknxl1DkWrU/SibBZWF9YsI/AAAAAAAABHc/I3JXTHAQspQ/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-1209097143119930135</id><published>2009-06-01T21:01:00.000-07:00</published><updated>2009-06-01T21:04:16.524-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bing'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft New Search Engine'/><title type='text'>Bing :  A decision making engine</title><content type='html'>Bing is new search engine from Microsoft; actually they say it is not search engine but decision making engine. Microsoft tries to live up to Google search.&lt;br /&gt;&lt;br /&gt;Bing is good in finding deals, so try it yourself &lt;a href="http://www.bing.com/"&gt;&lt;strong&gt;www.bing.com&lt;/strong&gt;&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-1209097143119930135?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/1209097143119930135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/bing-is-new-search-engine-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/1209097143119930135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/1209097143119930135'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/06/bing-is-new-search-engine-from.html' title='Bing :  A decision making engine'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-2961654648390571687</id><published>2009-05-25T08:21:00.001-07:00</published><updated>2009-05-25T08:21:25.446-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Windows Application'/><category scheme='http://www.blogger.com/atom/ns#' term='System.Management'/><category scheme='http://www.blogger.com/atom/ns#' term='Get all Logical Drives'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>List all the Logical Drive in the Computer : Windows Application, C#</title><content type='html'>&lt;p&gt;Using System.Management name space we can read the all operating system details and we query System_Win32 database in the following example I am trying to read all the logical drives in the computer and list them in a ListBox and select a drive and you can browse all the files in the drive.&lt;/p&gt;  &lt;p&gt;So lets start creating the example, open visual studio and create a Windows Forms Application.&lt;/p&gt;  &lt;p&gt;Add one list box and 2 buttons to the Form, you can below screen shot for the design&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Shq3UyI29NI/AAAAAAAABGU/gkdL1VnZL-Q/s1600-h/Design%5B3%5D.jpg"&gt;&lt;img title="Design" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="360" alt="Design" src="http://lh3.ggpht.com/_eknxl1DkWrU/Shq3V-mRHRI/AAAAAAAABGY/GpOq9Dd8ieU/Design_thumb%5B1%5D.jpg?imgmax=800" width="304" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we need to add the reference for the System.Management.dll to project so that we can make use of some class using which we can read all logical drives. Once you add the reference you need to import the System.Management namespace, you can refer below screen shot.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Shq3WpQKcMI/AAAAAAAABGc/UCYVTl0iKXQ/s1600-h/Reference%5B3%5D.jpg"&gt;&lt;img title="Reference" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="179" alt="Reference" src="http://lh6.ggpht.com/_eknxl1DkWrU/Shq3Xd_WLsI/AAAAAAAABGg/_AiiVER4TsI/Reference_thumb%5B1%5D.jpg?imgmax=800" width="433" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with Design part and reference part so let start putting code to retrieve drive, for that please double click on Get All Drives button and add following code, in the following code I am call a method GetAllDrives in which I am creating object for ManagementObjectSearcher and searching all the drives using “SELECT Caption, DeviceID FROM Win32_DiskDrive” query, please refer below screen shot for code&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Shq3YDe9U1I/AAAAAAAABGk/vA_5mhFf7NI/s1600-h/GetAllDrives%5B3%5D.jpg"&gt;&lt;img title="GetAllDrives" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="413" alt="GetAllDrives" src="http://lh4.ggpht.com/_eknxl1DkWrU/Shq3ZPRtc4I/AAAAAAAABGo/Pu0djHfJDbk/GetAllDrives_thumb%5B1%5D.jpg?imgmax=800" width="489" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are done with searching and listing all the drives in the local computer now we will add the code for opening the selected drive in listbox, please refer the below screen shot.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Shq3Z6g1YgI/AAAAAAAABGs/haRkq3PehQU/s1600-h/OpenDrive%5B4%5D.jpg"&gt;&lt;img title="OpenDrive" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="239" alt="OpenDrive" src="http://lh5.ggpht.com/_eknxl1DkWrU/Shq3bGoChSI/AAAAAAAABGw/tThJZmX89uI/OpenDrive_thumb%5B2%5D.jpg?imgmax=800" width="489" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We are now ready with our code just build, run and test.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Shq3cGhIXkI/AAAAAAAABG0/3LbV8cLrR_k/s1600-h/output%5B4%5D.jpg"&gt;&lt;img title="output" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="356" alt="output" src="http://lh4.ggpht.com/_eknxl1DkWrU/Shq3c7y-n4I/AAAAAAAABG4/mJ_ZTaq-4WA/output_thumb%5B2%5D.jpg?imgmax=800" width="496" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;Tags: Read all Logical Drives in Local Computer, C#, Windows Application, .NET&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-2961654648390571687?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/2961654648390571687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/list-all-logical-drive-in-computer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2961654648390571687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2961654648390571687'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/list-all-logical-drive-in-computer.html' title='List all the Logical Drive in the Computer : Windows Application, C#'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_eknxl1DkWrU/Shq3V-mRHRI/AAAAAAAABGY/GpOq9Dd8ieU/s72-c/Design_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-3618066700298090303</id><published>2009-05-23T00:25:00.001-07:00</published><updated>2009-05-23T00:27:03.670-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><title type='text'>What’s New In Visual Studio 2010 ASP.NET 4.0</title><content type='html'>&lt;p&gt;Microsoft has released Visual Studio 2010 and ASP.NET 4.0 beta 1 recently, I felt there are some amazing features which can help developers improve productivity.&lt;/p&gt;  &lt;p&gt;Please have look at screen shot of new feature below.&lt;/p&gt;  &lt;p&gt;1) &lt;strong&gt;New Start page&lt;/strong&gt; where you have 3 tabs, one is Welcome where we can find welcome note, feedback etc, second tab is project where you can create open projects, third one is Visual Studio tab where you have MSDN, community links&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/ShekttCjcWI/AAAAAAAABFU/QrZJrnX_FGs/s1600-h/image%5B3%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="317" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/ShekutXj3GI/AAAAAAAABFY/Y7LVBQH6UQw/image_thumb%5B1%5D.png?imgmax=800" width="446" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;2) Target Multiple Versions of .NET: we can build project on different version of .NET versions and also navigation of projects selection is improved.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/ShekwOy08zI/AAAAAAAABFc/019HXCScnyA/s1600-h/image%5B8%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="314" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/ShekxzAtJPI/AAAAAAAABFg/28y-tiTJVfA/image_thumb%5B4%5D.png?imgmax=800" width="447" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;3) Code Snippets: this is one of the best feature I felt in Visual Studio 2010 ASP.NET 4.0, type control name like button and press tab you will button control tag is generated for you similarly when you type script and press tab you will see script tags are created for you.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Sheky8HdRwI/AAAAAAAABFk/yAQrrtinT3E/s1600-h/image%5B13%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="236" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Shek0gvIXAI/AAAAAAAABFo/8hgpwmBDbRU/image_thumb%5B7%5D.png?imgmax=800" width="447" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Shek1qJiFxI/AAAAAAAABFs/DvRvt2N03tQ/s1600-h/image%5B18%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="236" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/Shek29BkMFI/AAAAAAAABFw/pMo2_QwoBJQ/image_thumb%5B10%5D.png?imgmax=800" width="447" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;4) FormView Improvements, normally when you use FormView Control it will be rendering HTML with Table tag now by default RenderTable = False if you want you can make it True this is still kept for compatible issues.&lt;/p&gt;  &lt;p&gt;5) Improved intelligence, now you can filter the intelligence result by pressing Ctrl+Alt+Space&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/Shek5CaCZOI/AAAAAAAABF0/ggKY22fVCXo/s1600-h/image%5B25%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="247" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/Shek6HZ9KaI/AAAAAAAABF4/2wVKuh73Z5U/image_thumb%5B13%5D.png?imgmax=800" width="467" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Shek7-CoaQI/AAAAAAAABF8/PQyyW747iFI/s1600-h/image%5B29%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="248" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/Shek8_Ptd6I/AAAAAAAABGA/PVyrigPoCqk/image_thumb%5B15%5D.png?imgmax=800" width="469" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;6) ViewState changes: Now ViewState of a control is by default inherit, that means you can set page level view state and under page all control can inherit its ViewState, if you want to set ViewState to one control separate then you can set for individual control.&lt;/p&gt;  &lt;p&gt;This can be done using ViewStateMode = “Inherit” / “Disable” / “Enable”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/Shek-FtGQfI/AAAAAAAABGE/evYf3UdqqXI/s1600-h/image%5B37%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="254" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/Shek_HXHgYI/AAAAAAAABGI/xMA7AhZ5Uq8/image_thumb%5B19%5D.png?imgmax=800" width="473" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;7) ASP.NET provides multiple ways of generating ClientID. You set a way of ClientID in following ways.    &lt;br /&gt;Legacy : The ClientID value is generated by concatenating the ID values of each parent naming container with the ID value of the control. In data-binding scenarios where multiple instances of a control are rendered, an incrementing value is inserted in front of the control's ID value. Each segment is separated by an underscore character (_). This algorithm was used in versions of ASP.NET earlier than ASP.NET 4.0.     &lt;br /&gt;Static : The ClientID value is set to the value of the ID property. If the control is a naming container, the control is used as the top of the hierarchy of naming containers for any controls that it contains.     &lt;br /&gt;Predictable : This algorithm is used for controls that are in data-bound controls. The ClientID value is generated by concatenating the ClientID value of the parent naming container with the ID value of the control. If the control is a data-bound control that generates multiple rows, the value of the data field specified in the ClientIDRowSuffix property is added at the end. For the GridView control, multiple data fields can be specified. If the ClientIDRowSuffix property is blank, a sequential number is added at the end instead of a data-field value. Each segment is separated by an underscore character (_).     &lt;br /&gt;Inherit : The control inherits the ClientIDMode setting of its parent control.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/ShelAVg5hsI/AAAAAAAABGM/Ya3ObPJ6m40/s1600-h/image%5B41%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="253" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/ShelBpoyDQI/AAAAAAAABGQ/_ee3eQ5DzvQ/image_thumb%5B21%5D.png?imgmax=800" width="479" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;These are very few of new features I will be posting more very soon.&lt;/p&gt;  &lt;p&gt;Hope this helps&lt;/p&gt;  &lt;p&gt;Tags: What's New in Visual Studio 2010, ASP.NET 4.0&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-3618066700298090303?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/3618066700298090303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/whats-new-in-visual-studio-2010-aspnet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3618066700298090303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3618066700298090303'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/whats-new-in-visual-studio-2010-aspnet.html' title='What’s New In Visual Studio 2010 ASP.NET 4.0'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_eknxl1DkWrU/ShekutXj3GI/AAAAAAAABFY/Y7LVBQH6UQw/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5963627267009379134</id><published>2009-05-22T07:54:00.001-07:00</published><updated>2009-05-22T07:55:54.186-07:00</updated><title type='text'>Read &amp; Write ListBox Item into File: Windows Application</title><content type='html'>&lt;p&gt;Normally some projects will have very small requirement of storing data, so going to have database and storing small amount of data into database is not suitable answer, you can go for storing data into XML or txt file, in following example I am trying to read and write Listbox items into txt file.   &lt;br /&gt;I am using Form_Load method to read data from the txt file and on closing the form I am reading all items in the list box and saving them into a txt file with , separator.    &lt;br /&gt;Let start building the example.    &lt;br /&gt;Create a windows forms applciation and add a List Box, a Text Box and 2 buttons.    &lt;br /&gt;Please refer the screen shot : Design.jpg.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/Sha8mza3fxI/AAAAAAAABE0/fnxy1_Ica0w/s1600-h/design%5B2%5D.jpg"&gt;&lt;img title="design" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="244" alt="design" src="http://lh6.ggpht.com/_eknxl1DkWrU/Sha8oZKKGfI/AAAAAAAABE4/G61bGOsf220/design_thumb.jpg?imgmax=800" width="209" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Make sure that you have created data.txt in c:\logs folder, here I am using C:\logs path you can create any where in the system and change page in the code.    &lt;br /&gt;Once you are ready with design and creating txt file, we will add code to read all the items in the text file in Form_Load and also in Form_Closing we will ad code to store all the items in to text file back please refer the code below in screen shot FomLoadUnload.JPG&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/Sha8pcgRaZI/AAAAAAAABE8/L7lu7jEXDdU/s1600-h/FomLoadUnload%5B3%5D.jpg"&gt;&lt;img title="FomLoadUnload" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="366" alt="FomLoadUnload" src="http://lh5.ggpht.com/_eknxl1DkWrU/Sha8q-4TpMI/AAAAAAAABFA/NGoB-UGvw8k/FomLoadUnload_thumb%5B1%5D.jpg?imgmax=800" width="384" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once we have added code to read and write to text file now we will add code to add and remove items in the list box, we are using Button2 for removing the items and Button1 for adding the items, please add Click event of Button 1 and 2 to the code, you can refer below code in screen shot AddRemoveItems.JPG&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Sha8r0F1zQI/AAAAAAAABFE/DlaNe3Q7D9I/s1600-h/AddRemoveItems%5B3%5D.jpg"&gt;&lt;img title="AddRemoveItems" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="291" alt="AddRemoveItems" src="http://lh5.ggpht.com/_eknxl1DkWrU/Sha8sv4MuxI/AAAAAAAABFI/9Y-eG_W6LQs/AddRemoveItems_thumb%5B1%5D.jpg?imgmax=800" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with code just build, run and test&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Sha8tiaG__I/AAAAAAAABFM/uDyi5fLaSpc/s1600-h/Output%5B3%5D.jpg"&gt;&lt;img title="Output" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="326" alt="Output" src="http://lh4.ggpht.com/_eknxl1DkWrU/Sha8vJNxRrI/AAAAAAAABFQ/GUujeoNCWGc/Output_thumb%5B1%5D.jpg?imgmax=800" width="412" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;hope this helps.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5963627267009379134?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5963627267009379134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/read-write-listbox-item-into-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5963627267009379134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5963627267009379134'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/read-write-listbox-item-into-file.html' title='Read &amp;amp; Write ListBox Item into File: Windows Application'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eknxl1DkWrU/Sha8oZKKGfI/AAAAAAAABE4/G61bGOsf220/s72-c/design_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-6899281231439346788</id><published>2009-05-20T07:49:00.001-07:00</published><updated>2009-05-25T07:44:59.435-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SMOs'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Management Objects'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Applicaton'/><title type='text'>Using SMOs, Read Tables Script using C#.NET</title><content type='html'>&lt;p&gt;SQL Server Management Objects (SMOs) are used manipulate database for DBA activities via an application build by you, you can automate some of the DBA tasks by using SMOs in the application. &lt;/p&gt;&lt;p&gt;In this article I am try to explain how we can use SMO to retrieve all the Table listed in Nortwind database and selecting a Table I am display its create script and listing down all the columns in that table. &lt;/p&gt;&lt;p&gt;So lets start create an example how to use SMOs. &lt;/p&gt;&lt;p&gt;Create a Windows Forms application and Add following controls &lt;/p&gt;&lt;p&gt;1) 2 List boxes one is for listing all the tables and one is for listing all the columns in particular table&lt;br /&gt;2) A Text box with multi line mode true and set scrollbars to Vertical &lt;/p&gt;&lt;p&gt;Refer Screen Shot: Design.JPG &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/ShQYAh6wzlI/AAAAAAAABEM/3VrzBr0i-T8/s1600-h/Design%5B2%5D.jpg"&gt;&lt;img title="Design" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="244" alt="Design" src="http://lh4.ggpht.com/_eknxl1DkWrU/ShQYCCLjMoI/AAAAAAAABEQ/UlEhWaiw2JE/Design_thumb.jpg?imgmax=800" width="187" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Once we have added controls and designed, we need add SMO DLLs for reference so that we can use built-in class. &lt;/p&gt;&lt;p&gt;You need to add following 4 DLL for reference&lt;br /&gt;1) Microsoft.SqlServer.ConnectionInfo&lt;br /&gt;2) Microsoft.SqlServer.Smo&lt;br /&gt;3) Microsoft.SqlServer.SmoEnum&lt;br /&gt;4) Microsoft.SqlServer.SqlEnum &lt;/p&gt;&lt;p&gt;You will find these DLL at following location:&lt;br /&gt;C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\ &lt;/p&gt;&lt;p&gt;Once you have added DLL import them for use, please refer screen shot: References.JPG &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/ShQYDT0qSrI/AAAAAAAABEU/21qPn5XYnHU/s1600-h/References%5B2%5D.jpg"&gt;&lt;img title="References" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="128" alt="References" src="http://lh3.ggpht.com/_eknxl1DkWrU/ShQYFewZSzI/AAAAAAAABEY/9XUZzMuuJm0/References_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Now we are ready with our design and references part, so let’s start writing code to get all the Tables in the Northwind Database and add to the ListBox1, for this I have to create a Server object which represents a SQL Server in the machine we need to pass the server name to create that object, here I am creating module level variable so that I can use it in other methods also. &lt;/p&gt;&lt;p&gt;Once you have created server object, you need to get the Database object and Database object will have collection of table, read the Table collection and add Table names to ListBox1, please can refer the code below and also screen shot:Form_Load.jpg &lt;/p&gt;&lt;p&gt; &lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/ShQYGr_7_eI/AAAAAAAABEc/uKmnD2YI3kw/s1600-h/Form_Load%5B3%5D.jpg"&gt;&lt;img title="Form_Load" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="179" alt="Form_Load" src="http://lh6.ggpht.com/_eknxl1DkWrU/ShQYSR28AyI/AAAAAAAABEg/zMiu5SwXBsQ/Form_Load_thumb%5B1%5D.jpg?imgmax=800" width="362" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Now ListBox1 has all the Tables in the Northwind database on selecting any of the table in ListBox1 we want to show all the columns of that table in Listbox2 and also display Create Script of that table in multi line Text box, for that we need to write code in listBox1_SelectedIndexChanged , we create a Table object using selected Table Name in ListBox1 and read all the columns of that table and display in ListBox2, you can refer below code and also screen shot ListColumns.jpg &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/ShQYUG33R9I/AAAAAAAABEk/QYT1EZRBCOA/s1600-h/ListColumns%5B3%5D.jpg"&gt;&lt;img title="ListColumns" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="244" alt="ListColumns" src="http://lh5.ggpht.com/_eknxl1DkWrU/ShQYWLgYl5I/AAAAAAAABEo/JdGmO2znirg/ListColumns_thumb%5B1%5D.jpg?imgmax=800" width="383" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Now we are ready with our code just build, run and test. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/ShQYXAFuTyI/AAAAAAAABEs/96AfP_kuz0Q/s1600-h/Output%5B2%5D.jpg"&gt;&lt;img title="Output" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="244" alt="Output" src="http://lh5.ggpht.com/_eknxl1DkWrU/ShQYYpZW_NI/AAAAAAAABEw/OXndgyKdJa0/Output_thumb.jpg?imgmax=800" width="230" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-6899281231439346788?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/6899281231439346788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/using-smos-read-tables-script-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6899281231439346788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6899281231439346788'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/using-smos-read-tables-script-using.html' title='Using SMOs, Read Tables Script using C#.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eknxl1DkWrU/ShQYCCLjMoI/AAAAAAAABEQ/UlEhWaiw2JE/s72-c/Design_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-3270856131495863603</id><published>2009-05-18T07:57:00.001-07:00</published><updated>2009-05-18T07:58:50.668-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Windows Application'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectoryInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Search Files in a Directory : Windows Application</title><content type='html'>&lt;p&gt;Following example I am trying to search files in a directory using a criteria, using DirectoryInfo.GetFiles() method we can search files with Criteria and you can use * to find all files those are starting with the some string.&lt;/p&gt;  &lt;p&gt;So lets start building example, create a windows forms application and add one label, text box, a button and list box, please refer following screen shot&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/ShF3HksCQnI/AAAAAAAABDM/All9DeoU-BA/s1600-h/image%5B3%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="294" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/ShF3JZpy35I/AAAAAAAABDQ/r4nCf69qWRU/image_thumb%5B1%5D.png?imgmax=800" width="314" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Add following function to Form1 which takes Search Text as file name and Folder Path where files needs to be searched, In following function I am taking FileName as search text and DirectoryName as folder path and searching the files&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/ShF3K6WpPpI/AAAAAAAABDs/SkwLdndrb2E/s1600-h/image%5B20%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="302" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/ShF3MlC3FKI/AAAAAAAABDw/Yn6TS_dGZ4k/image_thumb%5B10%5D.png?imgmax=800" width="432" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Double click on Search button add following code, following code I am simply taking the search text and selecting folder path and passing to the above function&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/ShF3NwBixVI/AAAAAAAABD8/J7CtSg9ncaA/s1600-h/image%5B19%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="107" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/ShF3TNz4tGI/AAAAAAAABEA/Q_2aVKBHajQ/image_thumb%5B9%5D.png?imgmax=800" width="427" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with Code, lets build, run and test&lt;/p&gt;  &lt;p&gt;Output:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/ShF3VRz8P1I/AAAAAAAABDk/4NM0DGCs-jA/s1600-h/image%5B18%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="221" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/ShF3WtxSUPI/AAAAAAAABDo/fjolTlNWjFw/image_thumb%5B8%5D.png?imgmax=800" width="446" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Tag: DirectoryInfo, FileInfo, C#, Windows Application, Search Files&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-3270856131495863603?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/3270856131495863603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/search-files-in-directory-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3270856131495863603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3270856131495863603'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/search-files-in-directory-windows.html' title='Search Files in a Directory : Windows Application'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_eknxl1DkWrU/ShF3JZpy35I/AAAAAAAABDQ/r4nCf69qWRU/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-1365685345488860912</id><published>2009-05-16T22:57:00.000-07:00</published><updated>2009-05-16T23:00:43.604-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TechEd 2009 India'/><title type='text'>TechEd 2009 India Experience</title><content type='html'>&lt;p&gt;I have attended Microsoft TechEd 2009 at Hyderabad HICC from 13 to 15 May 2009; it was great experience and a great chance to learn new technologies. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Day 1 Experience:&lt;br /&gt;It was awesome to Steve Ballmer speaking at TechEd, he mentioned about present and future opportunities in the market and he mentioned that we need to be more productive in the financial situation, do more with less will help us to come out from the present situation. He also mentioned that being innovative will help us go gain more opportunities. Day 1 I also attended Stephen Walther’s presentation what‘s new in ASP.NET 4.0&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Day 2 Experience:&lt;br /&gt;Attended Stephen Walther’s Presentation what’s New in ASP.NET AJAX 4.0, I also personally speak to him and had a photograph with him.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Day 3 Experience:&lt;br /&gt;Attended Presentations on Sliver Light and also some of SQL Server 2008 presentation and those were very informative.&lt;/p&gt;&lt;p&gt;Tags: TechEd 2009 India&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-1365685345488860912?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/1365685345488860912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/teched-2009-india-experience.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/1365685345488860912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/1365685345488860912'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/teched-2009-india-experience.html' title='TechEd 2009 India Experience'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-4933442094945751481</id><published>2009-05-16T22:38:00.000-07:00</published><updated>2009-05-16T22:45:52.164-07:00</updated><title type='text'>SQL Server 2008 Developer Training Kit Available</title><content type='html'>The training kit offers the following benefits:&lt;br /&gt;Learn how to build web applications that exploit the unique features and capabilities of SQL Server 2008.&lt;br /&gt;Provides a comprehensive set of presentations, demos and hands-on labs&lt;br /&gt;Designed for web developers who are already familiar with SQL Server application development.&lt;br /&gt;Easy to download and install and works on free editions of SQL Server 2008 and Visual Studio 2008.&lt;br /&gt;&lt;br /&gt;Produced by Southworks SRL, a well-known provider of evangelism content, using both existing and new content custom developed for this training kit.&lt;br /&gt;Software Requirements&lt;br /&gt;The following software is not included with the training kit and must be downloaded and installed separately.&lt;br /&gt;&lt;br /&gt;SQL Server 2008 Express with Advanced Services (or higher-level SKU)&lt;br /&gt;Microsoft Visual Web Developer 2008 Express (or higher-level SKU)&lt;br /&gt;AdventureWorks 2008 Sample Databases&lt;br /&gt;&lt;br /&gt;The training kit is available at the following URL:&lt;br /&gt;&lt;a href="http://go.microsoft.com/?linkid=9665942" target="_blank"&gt;SQL Server 2008 Developer Training Kit&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL Server 2008, Learn, Training Kit, SQL Server 2008 Learning Videos&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-4933442094945751481?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/4933442094945751481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/sql-server-2008-developer-training-kit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/4933442094945751481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/4933442094945751481'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/sql-server-2008-developer-training-kit.html' title='SQL Server 2008 Developer Training Kit Available'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-6421541911179694120</id><published>2009-05-12T09:49:00.001-07:00</published><updated>2009-05-12T09:49:35.365-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Windows Application'/><category scheme='http://www.blogger.com/atom/ns#' term='C# .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Export to .csv file'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGridView'/><title type='text'>Export DataGridView into .csv file</title><content type='html'>&lt;p&gt;Following example I am trying to save the DataGridView's Data into .csv file &lt;/p&gt;  &lt;p&gt;Please create a Windows Application and Add a DataGridView and a button on Form1, to fill the data initially please add following code in Form1_Load&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Sgmoj_Nq1vI/AAAAAAAABC8/HZGTAo9VgZA/s1600-h/image%5B3%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="133" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SgmokwMA6sI/AAAAAAAABDA/9XYPUVPr-D8/image_thumb%5B1%5D.png?imgmax=800" width="419" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Double click on the Button and add following code in Button1_Click, in this code we are reading all columns and rows and forming a string and saving in data.csv file&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SgmomT5M8xI/AAAAAAAABDE/DoYK20th8AU/s1600-h/image%5B7%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="252" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/Sgmonh2rCsI/AAAAAAAABDI/rxkz8ZeQrvE/image_thumb%5B3%5D.png?imgmax=800" width="425" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now we are ready with our code, just build, run and test.&lt;/p&gt;  &lt;p&gt;Tags: Export DataGridView to .csv file, Windows Forms, C#, .NET&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-6421541911179694120?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/6421541911179694120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/export-datagridview-into-csv-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6421541911179694120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6421541911179694120'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/export-datagridview-into-csv-file.html' title='Export DataGridView into .csv file'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_eknxl1DkWrU/SgmokwMA6sI/AAAAAAAABDA/9XYPUVPr-D8/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-9102907787371454359</id><published>2009-05-12T09:23:00.001-07:00</published><updated>2009-05-12T09:23:34.077-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Windows Application'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Handle Click Event of Eclipse: Windows Application</title><content type='html'>&lt;p&gt;Normally we dont have any event for the Drawing objects like circle, eclipse ect., so here I am trying to draw a eclipse using graphics and try to give clicking effect and handing that event. &lt;/p&gt;  &lt;p&gt;Declare the event handler and deligate to handle the events &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Sgmh6_hvgGI/AAAAAAAABCI/mKZupgtyuMU/s1600-h/image%5B20%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="61" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/Sgmh7t6EEWI/AAAAAAAABCM/9hISGTKsQOI/image_thumb%5B12%5D.png?imgmax=800" width="407" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Initialise the Click Event for eclipse we are drawing in Form_Load&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/Sgmh8sNK-iI/AAAAAAAABCQ/row0zjbqFuw/s1600-h/image%5B9%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="69" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SgmiJoD71fI/AAAAAAAABCU/KrTod8jh9TM/image_thumb%5B5%5D.png?imgmax=800" width="406" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Draw eclipse in Form paint method &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SgmiPlLeyeI/AAAAAAAABCY/HUDQu_JmUBY/s1600-h/image%5B21%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="115" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SgmiR0wKmmI/AAAAAAAABCc/-Y4I-JMqkPw/image_thumb%5B13%5D.png?imgmax=800" width="412" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;To give clicking effect we need to draw a similar eclipse when you&amp;#160; &lt;br /&gt;press the mouse, also check the bounds where mouse is being clicked, please add following code in Form1_MouseDown&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SgmiTgfriaI/AAAAAAAABCg/e_g1e0ZD42k/s1600-h/image%5B25%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="182" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SgmiVvJABMI/AAAAAAAABCk/CJF2c47OJdU/image_thumb%5B15%5D.png?imgmax=800" width="420" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And add following code in Form1_MouseUp&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SgmiWbCo-MI/AAAAAAAABCo/JPPkeKW_yvU/s1600-h/image%5B29%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="166" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SgmiXAUK4VI/AAAAAAAABCs/bMau-vfLJ2s/image_thumb%5B17%5D.png?imgmax=800" width="427" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Following event will be called when you click the eclipse, so please add following code block&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SgmibhvUgzI/AAAAAAAABC0/EGt4-K-y9CQ/s1600-h/image%5B33%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="122" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SgmihFskI6I/AAAAAAAABC4/OB4wQXjOHtc/image_thumb%5B19%5D.png?imgmax=800" width="441" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready our code just build, run and test.&lt;/p&gt;  &lt;p&gt;Tags: Drawing in C#, Eclipse, Handling Events&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-9102907787371454359?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/9102907787371454359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/handle-click-event-of-eclipse-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/9102907787371454359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/9102907787371454359'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/handle-click-event-of-eclipse-windows.html' title='Handle Click Event of Eclipse: Windows Application'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eknxl1DkWrU/Sgmh7t6EEWI/AAAAAAAABCM/9hISGTKsQOI/s72-c/image_thumb%5B12%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-3997172234102652113</id><published>2009-05-09T00:22:00.001-07:00</published><updated>2009-05-09T00:22:35.566-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Windows Application'/><category scheme='http://www.blogger.com/atom/ns#' term='ComboBox in DataGridView'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGridView'/><category scheme='http://www.blogger.com/atom/ns#' term='Controls In DataGridView'/><title type='text'>Getting the Selected Value of Combo Box in DataGridView</title><content type='html'>&lt;p&gt;In following example I am try to get the Selected value of Combo Box which is in DataGridView.   &lt;br /&gt;Create a Windows Applicaiton and Add a DataGridView in the Form1 &lt;/p&gt;  &lt;p&gt;We need to initialise DataGridViewEditingControlShowingEventHandler of DataGridView to handle its control events, so please use follwoing code in Forms Constructor&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SgUuzdQDJOI/AAAAAAAABBg/EYj-ht5K-jo/s1600-h/image%5B5%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="95" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SgUu6cKBhHI/AAAAAAAABBk/z57qjkv8Xss/image_thumb%5B3%5D.png?imgmax=800" width="419" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the form load we will fetch all the data and assign to DataGridView&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SgUu78UK9uI/AAAAAAAABBo/TBstG0gTSwc/s1600-h/image%5B9%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="265" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SgUu-EWKIkI/AAAAAAAABBs/a8xuZZNTwgI/image_thumb%5B5%5D.png?imgmax=800" width="435" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now catch the control edit event in the DataGridView and assign the SelectIndexChanged event to each Combo Box in DataGridView&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SgUvAR2Ta4I/AAAAAAAABBw/iFRI0gPLrkk/s1600-h/image%5B13%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="191" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SgUvCVXxSYI/AAAAAAAABB0/KDUOVcvsrW8/image_thumb%5B7%5D.png?imgmax=800" width="450" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Add Follwoing Combo Box's SelectedIndexChanged which we assigned to all the combo boxes in DataGridView&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SgUvEecfCKI/AAAAAAAABB4/A4csWZPHEWg/s1600-h/image%5B18%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="147" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SgUvJEz7RPI/AAAAAAAABB8/tlRu5kG3tYQ/image_thumb%5B10%5D.png?imgmax=800" width="451" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our code lets build, run and test.&lt;/p&gt;  &lt;p&gt;Output:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SgUvMaTEu5I/AAAAAAAABCA/azJRrD-mHSs/s1600-h/image%5B22%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="246" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SgUvOU2yAHI/AAAAAAAABCE/RbnKZOu8tb0/image_thumb%5B12%5D.png?imgmax=800" width="359" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Tags: Getting the Selected Value of Combo Box in DataGridView, DataGridView&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-3997172234102652113?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/3997172234102652113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/getting-selected-value-of-combo-box-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3997172234102652113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3997172234102652113'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/getting-selected-value-of-combo-box-in.html' title='Getting the Selected Value of Combo Box in DataGridView'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eknxl1DkWrU/SgUu6cKBhHI/AAAAAAAABBk/z57qjkv8Xss/s72-c/image_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-3532553568304659980</id><published>2009-05-06T11:16:00.001-07:00</published><updated>2009-05-06T11:16:34.352-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Windows Application'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Outlook Contacts'/><title type='text'>Reading Outlook Contacts in VB.NET</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;In this article I am trying to read the Outlook contact into a Combo Box and selecting a contact I am displaying his/ her details in below Label controls, so lets start building example. &lt;/p&gt;  &lt;p&gt;Create a Windows Forms Application and Add Label and Combo Box and change the lable text to Select Contact. &lt;/p&gt;  &lt;p&gt;To use the Outlook object in our project we need include a dll from the add references, now add a reference and select &amp;quot;Microsoft.Office.Interop.Outlook&amp;quot; dll from the list. &lt;/p&gt;  &lt;p&gt;After adding the dll, now we will import the name space for that use following import&lt;/p&gt;  &lt;p&gt;To access Outlook we need to create a object for Outlook via its interface and to get current session we need a NameSpace object to create these object use following code&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SgHT3OmTtyI/AAAAAAAABBA/EEL_YfPMvb8/s1600-h/Imports%5B5%5D.jpg"&gt;&lt;img title="Imports" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="115" alt="Imports" src="http://lh6.ggpht.com/_eknxl1DkWrU/SgHT4AKQ7fI/AAAAAAAABBE/fiUiD48SE9w/Imports_thumb%5B3%5D.jpg?imgmax=800" width="406" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now in the Form Load we will initialise the objects and fill the combo box with contact names, for that in the Form_Load use following code&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SgHT5I6B23I/AAAAAAAABBI/DPNeXq_r-Sc/s1600-h/FormLoad%5B3%5D.jpg"&gt;&lt;img title="FormLoad" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="324" alt="FormLoad" src="http://lh6.ggpht.com/_eknxl1DkWrU/SgHT7e77H6I/AAAAAAAABBM/v-eQbf9PsVo/FormLoad_thumb%5B1%5D.jpg?imgmax=800" width="413" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once we get the list of contacts in the Combo box use will select a Contact on selecting a contact we will display his or her details in the labels we put on the form for that we need to add following coding in the ComboBox_SelectedIndexChanged event, basically we are searching through all contacts and get the selected contact and display his or her details&lt;/p&gt;  &lt;p&gt;We need to clear the object memory we used in the project in Form_Disposed event&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SgHT8Y3Ov1I/AAAAAAAABBQ/mWbeuJVNb7k/s1600-h/ComboBoxSelect%5B3%5D.jpg"&gt;&lt;img title="ComboBoxSelect" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="294" alt="ComboBoxSelect" src="http://lh6.ggpht.com/_eknxl1DkWrU/SgHT9mG2VlI/AAAAAAAABBU/2FV8mXY5Xls/ComboBoxSelect_thumb%5B1%5D.jpg?imgmax=800" width="429" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our code just build, run and test&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SgHT_AYMzYI/AAAAAAAABBY/7m6caoX6HP0/s1600-h/Output%5B3%5D.jpg"&gt;&lt;img title="Output" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="298" alt="Output" src="http://lh4.ggpht.com/_eknxl1DkWrU/SgHUAOBalCI/AAAAAAAABBc/gkwDxvB5feg/Output_thumb%5B1%5D.jpg?imgmax=800" width="443" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Tags: Reading Outlook Contacts using VB.NET&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-3532553568304659980?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/3532553568304659980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/reading-outlook-contacts-in-vbnet.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3532553568304659980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3532553568304659980'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/reading-outlook-contacts-in-vbnet.html' title='Reading Outlook Contacts in VB.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eknxl1DkWrU/SgHT4AKQ7fI/AAAAAAAABBE/fiUiD48SE9w/s72-c/Imports_thumb%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5808197723872930491</id><published>2009-05-05T23:20:00.000-07:00</published><updated>2009-05-06T10:35:18.960-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reading ini File VB.NET'/><title type='text'>Reading ini File using VB.NET</title><content type='html'>Following fucntion reads INI file by Section and Keys and get the value of the Section. Following function uses GetPrivateProfileStringW API function to read the INI file  &lt;br /&gt;  &lt;br /&gt;  &lt;p&gt;&lt;font face="Courier New" color="#0000ff"&gt;Private Declare Unicode Function GetPrivateProfileString Lib &amp;quot;kernel32&amp;quot; _     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Alias &amp;quot;GetPrivateProfileStringW&amp;quot; (ByVal lpApplicationName As String, _      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ByVal lpKeyName As String, ByVal lpDefault As String, _      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ByVal lpReturnedString As String, ByVal nSize As Int32, _      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ByVal lpFileName As String) As Int32 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" color="#0000ff"&gt;Public Overloads Sub ReadINIFile(ByVal INIPath As String, _     &lt;br /&gt;ByVal SectionName As String, ByVal KeyName As String(), _      &lt;br /&gt;ByRef KeyValue As String())      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Dim Length As Integer      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Dim strData As String      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; strData = Space$(1024)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; For i As Integer = 1 To KeyName.Length - 1      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If KeyName(i) &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'This will read the ini file using Section Name and Key      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Length = GetPrivateProfileString(SectionName, KeyName(i), KeyValue(i), _      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; strData, strData.Length, LTrim(RTrim((INIPath))))      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If Length &amp;gt; 0 Then      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; KeyValue(i) = strData.Substring(0, Length)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Else      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; KeyValue(i) = &amp;quot;&amp;quot;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Next      &lt;br /&gt;End Sub&lt;/font&gt;&lt;/p&gt;  &lt;br /&gt;Testing above function  &lt;br /&gt;Create a Sample INI file using below text in C:\Logs\test.ini  &lt;br /&gt;[Sample Section 1]  &lt;br /&gt;SampleKey1=SAMPLEVALUE1  &lt;br /&gt;SampleKey2=SAMPLEVALUE2  &lt;br /&gt;[Sample Section 2]  &lt;br /&gt;SampleKey3=SAMPLEVALUE3  &lt;br /&gt;SampleKey4=SAMPLEVALUE4  &lt;br /&gt;  &lt;br /&gt;And use following code  &lt;br /&gt;&lt;font face="Courier New" color="#0000ff"&gt;Dim KeyName(2) As String   &lt;br /&gt;Dim KeyValues(2) As String    &lt;br /&gt;KeyName(1) = &amp;quot;ServerName&amp;quot;    &lt;br /&gt;KeyName(2) = &amp;quot;DBName&amp;quot;    &lt;br /&gt;ReadINIFile(&amp;quot;C:\Logs\test.ini&amp;quot;, &amp;quot;TEST Server&amp;quot;, KeyName, KeyValues)    &lt;br /&gt;MessageBox.Show(KeyValues(1) &amp;amp; &amp;quot; &amp;quot; &amp;amp; KeyValues(2))    &lt;br /&gt;&lt;/font&gt;  &lt;br /&gt;Hope this helps    &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5808197723872930491?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5808197723872930491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/reading-ini-file-using-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5808197723872930491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5808197723872930491'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/reading-ini-file-using-vbnet.html' title='Reading ini File using VB.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5250157095246967908</id><published>2009-05-04T23:02:00.000-07:00</published><updated>2009-05-05T09:51:11.961-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='All TextBoxes'/><category scheme='http://www.blogger.com/atom/ns#' term='Validate JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='document.getElementByTagName'/><title type='text'>Validate All TextBoxes Using JavaScript</title><content type='html'>Using following function you can find out all text boxes in the page are entered a value or not, no need to manually write each text box name to validate.  &lt;br /&gt;  &lt;br /&gt;  &lt;p&gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;   &lt;br /&gt;function validate() {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; // Get all input controls    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var arrTextBox = document.getElementsByTagName(&amp;quot;input&amp;quot;);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var retValue = 1;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; // Loop through all controls    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; for(i=0;i&amp;lt;arrTextBox.length;i++)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Check whether control is textbox and has a value    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (arrTextBox[i].type == &amp;quot;text&amp;quot; &amp;amp;&amp;amp; arrTextBox[i].value == &amp;quot;&amp;quot;) {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retValue = 0;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; //based on the validation return the value    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (retValue == 0) {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; alert(&amp;quot;Validation Failed&amp;quot;);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return false;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; else {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; alert(&amp;quot;Validation Success&amp;quot;);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return true;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;}    &lt;br /&gt;&amp;lt;script&amp;gt;&lt;/p&gt;  &lt;br /&gt;Tags : Validate JavaScript, All TextBoxes, document.getElementByTagName    &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5250157095246967908?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5250157095246967908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/validate-all-textboxes-using-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5250157095246967908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5250157095246967908'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/validate-all-textboxes-using-javascript.html' title='Validate All TextBoxes Using JavaScript'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-2568191389711665156</id><published>2009-05-02T07:19:00.001-07:00</published><updated>2009-05-09T21:58:34.767-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Announcement'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft Tech ED 2009'/><title type='text'>Microsoft Tech-Ed 2009 At Hyderabad</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Microsoft’s Tech-Ed is going to happen in Hyderabad this year, you can here latest technology news from Microsoft speakers who are actually involved in developing that particular technology.&lt;/p&gt;  &lt;p&gt;Tech-Ed is one place where you can make yourself ready for next generation technology, today's economic scenario you need to be ahead of others so this Tech-Ed will help you to stay ahead of others.&lt;/p&gt;  &lt;p&gt;You can know about the event at&amp;#160; &lt;a title="Home" href="http://www.microsoft.com/india/teched2009/default.aspx"&gt;Tech-Ed 2009&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can see what is the agenda at &lt;a href="http://www.microsoft.com/india/teched2009/agenda.aspx"&gt;Day 1&lt;/a&gt;&amp;#160;&lt;a href="http://www.microsoft.com/india/teched2009/agenda_may14.aspx"&gt;Day 2&lt;/a&gt;&amp;#160;&lt;a href="http://www.microsoft.com/india/teched2009/agenda_may15.aspx"&gt;Day 3&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can register for the event at &lt;a title="Register" href="http://www.microsoft.com/india/teched2009/register.aspx"&gt;Register&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Tags: Tech-Ed 2009, ASP.NET&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-2568191389711665156?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/2568191389711665156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/microsoft-tech-ed-2009-at-hyderabad.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2568191389711665156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2568191389711665156'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/05/microsoft-tech-ed-2009-at-hyderabad.html' title='Microsoft Tech-Ed 2009 At Hyderabad'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5306810149236025312</id><published>2009-04-28T20:12:00.001-07:00</published><updated>2009-04-28T20:12:16.041-07:00</updated><title type='text'>Most Valuable Member : DotnetSpider.com</title><content type='html'>&lt;p&gt;Today I have received The Most Valuable Member award from the DotnetSpider team, I am active on Dotnetspider.com forum from last 4 years.&lt;/p&gt;  &lt;p&gt;Recently they introduced the MVM award for the best and quality contributors, I am very happy to receive this.&lt;/p&gt;  &lt;p&gt;You can find the post at &lt;a href="http://www.dotnetspider.com/forum/203217-Winners-MVM-award.aspx" target="_blank"&gt;DotnetSpider MVMs&lt;/a&gt; and my profile in dotnetspider at &lt;a href="http://www.dotnetspider.com/member/satishkumarj.aspx" target="_blank"&gt;My Profile&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I am also happy for other members who got this award as this is prestigious to us.&lt;/p&gt;  &lt;p&gt;Congratulations to all the Winners.&lt;/p&gt;  &lt;p&gt;I would like to take this opportunity to thank each and every member in the forum.&lt;/p&gt;  &lt;p&gt;Also I would like to thank editors, Raghav and Tony for your support towards me all the time.&lt;/p&gt;  &lt;p&gt;Cheers,&lt;/p&gt;  &lt;p&gt;Satish.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5306810149236025312?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5306810149236025312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/most-valuable-member-dotnetspidercom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5306810149236025312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5306810149236025312'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/most-valuable-member-dotnetspidercom.html' title='Most Valuable Member : DotnetSpider.com'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-7371038847235005062</id><published>2009-04-23T08:41:00.001-07:00</published><updated>2009-04-23T08:41:14.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dynamic Controls'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creating Dynamic Controls, and Preserve them for alternate Page Loads : ASP.NET</title><content type='html'>&lt;p&gt;Normally when you create a control dynamically means at runtime, on the next &lt;a href="http://www.dotnetspider.com/resources/27890-Creating-Dynamic-Controls-also-preserve-already.aspx#"&gt;page load&lt;/a&gt; you will loose that control, that control will be no longer exists, in this example I am try to explain how we can store that controls and get them back.    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Create a Web &lt;a href="http://www.dotnetspider.com/resources/27890-Creating-Dynamic-Controls-also-preserve-already.aspx#"&gt;Application&lt;/a&gt; and Add one button to it.    &lt;br /&gt;In the page load add following code, in the following code I am creating a object of Control Collection and keeping it in the Session.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SfCMC56xmbI/AAAAAAAABAw/xgSJ-Fq_dyM/s1600-h/image%5B3%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="133" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SfCMDgNNsMI/AAAAAAAABA0/UDyM5-8JqYY/image_thumb%5B1%5D.png?imgmax=800" width="420" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now Doble click on button1 and add following code in Button1_Click event.   &lt;br /&gt;Here in this code I am storing all the controls created into control collection and saving into session.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SfCMEen5a5I/AAAAAAAABA4/6N7p4QrIeWI/s1600-h/image%5B13%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="520" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/SfCMF1Ww_DI/AAAAAAAABA8/ITzh0rj8LfI/image_thumb%5B7%5D.png?imgmax=800" width="427" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;now we are ready with code just build, run and test.&lt;/p&gt;  &lt;p&gt;Tags: Creating Dynamic controls, ASP.NET, C#, Preserve the Dynamic controls&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-7371038847235005062?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/7371038847235005062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/creating-dynamic-controls-and-preserve.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/7371038847235005062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/7371038847235005062'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/creating-dynamic-controls-and-preserve.html' title='Creating Dynamic Controls, and Preserve them for alternate Page Loads : ASP.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eknxl1DkWrU/SfCMDgNNsMI/AAAAAAAABA0/UDyM5-8JqYY/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-7815586255107200333</id><published>2009-04-20T02:43:00.000-07:00</published><updated>2009-04-20T02:56:27.460-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Smart Devices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL CE 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='.sdf files'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Comact Framework'/><title type='text'>Saving, Retrieving Data in Smart Device Applications</title><content type='html'>In this example I am try to use SQL Compact Edition with Smart Device Applications.&lt;br /&gt;&lt;br /&gt;We can store data and update the data in the device using SQL CE, so lets start building a example.&lt;br /&gt;&lt;br /&gt;Create SmartDeviceProject and add 2 Forms to it, please design the Form1 &amp;amp; Form2 as displayed in the Screen shot.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5326707779093710674" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 317px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SexEgMMwx1I/AAAAAAAAA_8/dAcrNWEZoa0/s400/Forms.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;Now lets create a SQL CE database file, for that please right click on the project add new file and select Database file and name it as Employees.sdf&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5326708264398951554" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 291px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SexE8cGjFII/AAAAAAAABAE/yiDI9o1qTl8/s400/AddDatabase.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;After adding the database file, create a table with following fields.&lt;br /&gt;ID int&lt;br /&gt;Name nVarchar&lt;br /&gt;City nVarchar&lt;br /&gt;Designation nVarchar&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SexFxQ3D_VI/AAAAAAAABAM/x282zeHnqOM/s1600-h/CreateTable.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5326709171914276178" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 268px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SexFxQ3D_VI/AAAAAAAABAM/x282zeHnqOM/s400/CreateTable.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now we are ready with design part lets write some code to insert data into table.&lt;br /&gt;&lt;br /&gt;Now double click on the Add button and add following code, in the following code we are creating SQLCeConncetion object and SQLCeCommand Object to insert the data into the .sdf file, it is almost similar how we insert data into normal SQL Server database, normally our database file will be saved on the device where the application is installed so I have taken the path of the .sdf and creating a connection.&lt;br /&gt;&lt;br /&gt;Double click on the View button and create a object for Form2 where will show all the employees details.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_eknxl1DkWrU/SexFxUzlD2I/AAAAAAAABAU/jXiVu7uwwYM/s1600-h/Form1Code.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5326709172973408098" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 230px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_eknxl1DkWrU/SexFxUzlD2I/AAAAAAAABAU/jXiVu7uwwYM/s400/Form1Code.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now open the Form2 and add grid and one button as shown in the screen shot above, in Form2_Load event write the code to fill the datagrid, double click on back button and write a code to go back to Form1&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SexFxht6nYI/AAAAAAAABAc/VU8DUd5YUhA/s1600-h/Form2Code.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5326709176439315842" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 172px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SexFxht6nYI/AAAAAAAABAc/VU8DUd5YUhA/s400/Form2Code.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now we are ready with our code let built, run and Test&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_eknxl1DkWrU/SexFxiNL1HI/AAAAAAAABAk/jVbVbcwxBSY/s1600-h/Output.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5326709176570467442" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 305px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_eknxl1DkWrU/SexFxiNL1HI/AAAAAAAABAk/jVbVbcwxBSY/s400/Output.JPG" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-7815586255107200333?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/7815586255107200333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/saving-retrieving-data-in-smart-device.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/7815586255107200333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/7815586255107200333'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/saving-retrieving-data-in-smart-device.html' title='Saving, Retrieving Data in Smart Device Applications'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_eknxl1DkWrU/SexEgMMwx1I/AAAAAAAAA_8/dAcrNWEZoa0/s72-c/Forms.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-2479165611749007589</id><published>2009-04-11T23:57:00.001-07:00</published><updated>2009-04-11T23:57:30.726-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MulitiView Control'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Tab Control in ASP.NET'/><title type='text'>Implementing Tabs using MultiView Control : ASP.NET</title><content type='html'>&lt;p&gt;Using MultiView control in ASP.NET we can achieve tabs in a web page, now in this example I am going to explain how we can create tabs using MulitView control&lt;/p&gt;  &lt;p&gt;Create a web application and add a Table control with 1 row and 3 columns and a MultiView control with 3 views, you can refer below screen shot&lt;/p&gt;  &lt;p&gt; Here we are adding 3 cells using table control and each cell will have a link button which acts as Tab&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SeGQzdcRZ8I/AAAAAAAAA_U/B2Jf0zzB2c8/s1600-h/image%5B9%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SeGQ0ghjLbI/AAAAAAAAA_Y/EnPAH7I1Fv0/image_thumb%5B5%5D.png?imgmax=800" width="459" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We need to set &lt;strong&gt;ActiveViewIndex&lt;/strong&gt; property of a MultiView control to see particular tab for that initially in Page_Load we set &lt;strong&gt;ActiveViewIndex&lt;/strong&gt; to 0 and on clicking every link we will call TabChange event to show the particular tab, in the below code we identify which link button is clicked and based that we will change the ActiveViewIndex to show the contents&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SeGQ1Ns-QEI/AAAAAAAAA_c/kSqV4joMt8I/s1600-h/image%5B14%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="391" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SeGQ2Ty8G8I/AAAAAAAAA_g/niWM_KDzoEw/image_thumb%5B8%5D.png?imgmax=800" width="446" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with out code, just build, run and test&lt;/p&gt;  &lt;p&gt;Hope this helps&lt;/p&gt;  &lt;p&gt;Tags : Tab control in ASP.NET, MulitView control, Satish Kumar J&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-2479165611749007589?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/2479165611749007589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/implementing-tabs-using-multiview.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2479165611749007589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2479165611749007589'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/implementing-tabs-using-multiview.html' title='Implementing Tabs using MultiView Control : ASP.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_eknxl1DkWrU/SeGQ0ghjLbI/AAAAAAAAA_Y/EnPAH7I1Fv0/s72-c/image_thumb%5B5%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5532426454009011398</id><published>2009-04-10T09:20:00.001-07:00</published><updated>2009-04-10T09:21:23.144-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Save Images Access Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Save Images into Database'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Save Images in Access Database : ASP.NET</title><content type='html'>&lt;p&gt;Using OLE Object we can save images in Access Database, in this example we will select a image and save that image in Access database using ASP.NET.&lt;/p&gt;  &lt;p&gt;First we will start creating a table in access database. &lt;/p&gt;  &lt;p&gt;Create a table &lt;strong&gt;ImageTable&lt;/strong&gt; with following fields&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;ID&amp;#160;&amp;#160;&amp;#160; AutoNumber (Primary Key)&lt;/li&gt;    &lt;li&gt;ImageName&amp;#160;&amp;#160; Text&lt;/li&gt;    &lt;li&gt;ImageValue OLE Object&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Now create a WebApplication and add following controls on the Web Form&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Upload Control&lt;/li&gt;    &lt;li&gt;Button for uploading image and saving into database&lt;/li&gt;    &lt;li&gt;DropdownList for listing all the images in Dabase Table&lt;/li&gt;    &lt;li&gt;Button for saving the image into a folder&lt;/li&gt;    &lt;li&gt;Image to show the image save on the disk&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Sd9xkdJmZhI/AAAAAAAAA-c/qdJstW-ncHA/s1600-h/html%5B3%5D.jpg"&gt;&lt;img title="html" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="241" alt="html" src="http://lh3.ggpht.com/_eknxl1DkWrU/Sd9xld5mx9I/AAAAAAAAA-g/NFo22JZL9Sg/html_thumb%5B1%5D.jpg?imgmax=800" width="401" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Initially we will fetch the image names which are already saved in the table and show in the drop down list,&amp;#160; for that use Page_Load method and insert following code&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Sd9xmP1_ezI/AAAAAAAAA-k/OwauucASZmk/s1600-h/Page_Load%5B3%5D.jpg"&gt;&lt;img title="Page_Load" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="350" alt="Page_Load" src="http://lh4.ggpht.com/_eknxl1DkWrU/Sd9xnmxONHI/AAAAAAAAA-o/eA5D7f_H5IE/Page_Load_thumb%5B1%5D.jpg?imgmax=800" width="418" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;now double click on upload image button and add following code, in following code we are just reading the image into stream of bytes and we are storing into the database&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Sd9xo_Pt8PI/AAAAAAAAA-s/cQHUuxPpBeM/s1600-h/UploadImage%5B3%5D.jpg"&gt;&lt;img title="UploadImage" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="364" alt="UploadImage" src="http://lh4.ggpht.com/_eknxl1DkWrU/Sd9xplKG6EI/AAAAAAAAA-w/MEJIzyNuC-w/UploadImage_thumb%5B1%5D.jpg?imgmax=800" width="415" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To resave the image on to the disk we will use following code, once we save image from database to disk we will show that image in image1 control.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/Sd9xrC5h_xI/AAAAAAAAA-0/msLUmVNP-1k/s1600-h/SaveImage%5B4%5D.jpg"&gt;&lt;img title="SaveImage" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="520" alt="SaveImage" src="http://lh4.ggpht.com/_eknxl1DkWrU/Sd9xr3DpRJI/AAAAAAAAA-4/TJ4897goLD4/SaveImage_thumb%5B2%5D.jpg?imgmax=800" width="454" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;now we are ready with our code just build, run and test&lt;/p&gt;  &lt;p&gt;hope this helps&lt;/p&gt;  &lt;p&gt;Tags: Save images in Access Database, ASP.NET, Save images in Database&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5532426454009011398?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5532426454009011398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/save-images-in-access-database-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5532426454009011398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5532426454009011398'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/save-images-in-access-database-aspnet.html' title='Save Images in Access Database : ASP.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_eknxl1DkWrU/Sd9xld5mx9I/AAAAAAAAA-g/NFo22JZL9Sg/s72-c/html_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5373457214682540421</id><published>2009-04-08T02:48:00.000-07:00</published><updated>2009-04-08T02:50:00.528-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IsNumeric in C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>IsNumeric in C#</title><content type='html'>In C#.NET we don’t have IsNumeric function; to achieve same functionality as IsNumeric in C# we can make use of Double.TryParse. Please find following example how we can achieve this&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#3366ff;"&gt;            double db;&lt;br /&gt;            string strInput = "SomeValue";&lt;br /&gt;            if (double.TryParse(strInput, out db))&lt;br /&gt;            {&lt;br /&gt;                Response.Write(db.ToString());&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                Response.Write("Not a number");&lt;br /&gt;            }&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;Hope this helps.&lt;br /&gt; Tag: IsNumeric in C#, .NET&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5373457214682540421?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5373457214682540421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/isnumeric-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5373457214682540421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5373457214682540421'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/isnumeric-in-c.html' title='IsNumeric in C#'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-2155567896156411457</id><published>2009-04-06T00:17:00.000-07:00</published><updated>2009-04-06T00:23:45.255-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='All Sundays in a Year'/><title type='text'>Get All Sundays in a Year</title><content type='html'>Following function will return all the Sundays in a specified Year.&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;        /// This function will return all the dates of sundays in a Year      &lt;br /&gt;/// for example if you pass if year is 2009       &lt;br /&gt;/// it will return all the dates of sundays in the year in form of list       &lt;br /&gt;/// &lt;/summary&gt;       &lt;br /&gt;/// &lt;param name="year"&gt;Year&lt;/param&gt;       &lt;br /&gt;/// &lt;returns&gt;List&lt;string&gt; all dates of sundays in form of list string &lt;/returns&gt;       &lt;br /&gt;public List&lt;string&gt; getAllWeekDates(int Year)       &lt;br /&gt;{&lt;br /&gt;            List&lt;string&gt; strDates = new List&lt;string&gt;();&lt;br /&gt;            for (int month = 1; month &lt;= 12; month++)&lt;br /&gt;           {&lt;br /&gt;                DateTime dt = new DateTime(Year, month, 1);&lt;br /&gt;                int firstSundayOfMonth = (int)dt.DayOfWeek;&lt;br /&gt;                if (firstSundayOfMonth != 0)&lt;br /&gt;                {&lt;br /&gt;                    dt = dt.AddDays((6 - firstSundayOfMonth) + 1);&lt;br /&gt;                }&lt;br /&gt;                while (dt.Month == month)&lt;br /&gt;                {&lt;br /&gt;                    strDates.Add(dt.ToString("dd/MMM/yyyy"));&lt;br /&gt;                    dt = dt.AddDays(7);&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            return strDates;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;Testing above function&lt;br /&gt;&lt;br /&gt;            List&lt;string&gt; allSundays = getAllWeekDates(DateTime.Now.Year);&lt;br /&gt;            DropDownList1.DataSource = allSundays;&lt;br /&gt;            DropDownList1.DataBind();&lt;br /&gt;&lt;br /&gt;Hope this helps&lt;br /&gt;&lt;br /&gt;Tags: .NET, C# DateTime, All Sundays in a Year&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-2155567896156411457?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/2155567896156411457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/get-all-sundays-in-year.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2155567896156411457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2155567896156411457'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/get-all-sundays-in-year.html' title='Get All Sundays in a Year'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-8302754533555147979</id><published>2009-04-02T08:53:00.001-07:00</published><updated>2009-04-05T05:41:24.498-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Export to Excel DataGridView ASP.NET'/><title type='text'>Export to Excel from DataGridView</title><content type='html'>&lt;p&gt;Here I am explaining, how we can generate Excel file from the DataGridView.&lt;/p&gt;  &lt;p&gt;Here I am using DataTable.WriteXML method generate the excel file.&lt;/p&gt;  &lt;p&gt;Create a Window Forms Application and on the Form1 add following controls&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt; DataGridView&lt;/li&gt;    &lt;li&gt; Button and rename to “Generate Excel File” &lt;/li&gt;    &lt;li&gt; FolderBrowserControl&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/SdTfRVaOcnI/AAAAAAAAA98/WyEdSoFRux4/s1600-h/image%5B2%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="239" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SdTfSxKmHFI/AAAAAAAAA-A/zgQPN1BRyCs/image_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now add following code in Form1_Load Event, in following code I am creating a DataAdapter to get the data from data base and assigning DataGridView’s DataSource.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/SdTfUMxs-OI/AAAAAAAAA-E/GYOKufHvClw/s1600-h/image%5B5%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="74" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/SdTfVDNAlSI/AAAAAAAAA-I/FVgC5BJAfoE/image_thumb%5B1%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And add following code in Button1_Click event, In following code I getting back the DataSource and converting it into DataTable and using DataTable’s WriteXML method I am generating Excel File.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/SdTfV9j_-EI/AAAAAAAAA-M/HUr78ON6lmQ/s1600-h/image%5B8%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="122" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/SdTfWj0zJcI/AAAAAAAAA-Q/JJor1cRNNzs/image_thumb%5B2%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our code just Build, Run and Test&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/SdTfXh17KsI/AAAAAAAAA-U/N4AEauVXP7Q/s1600-h/image%5B11%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="140" alt="image" src="http://lh3.ggpht.com/_eknxl1DkWrU/SdTfY5o3InI/AAAAAAAAA-Y/CqdMIOyI4lA/image_thumb%5B3%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hope This Helps.&lt;/p&gt;  &lt;p&gt;Tags: DataGridView, Excel, Export, C#, windows&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-8302754533555147979?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/8302754533555147979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/export-to-excel-from-datagridview.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/8302754533555147979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/8302754533555147979'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/04/export-to-excel-from-datagridview.html' title='Export to Excel from DataGridView'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eknxl1DkWrU/SdTfSxKmHFI/AAAAAAAAA-A/zgQPN1BRyCs/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-3777353896916932201</id><published>2009-03-29T22:47:00.000-07:00</published><updated>2009-04-05T05:42:26.787-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET HttpWebRequest HttpWebResponse'/><title type='text'>HttpWebRequest and HttpWebResponse</title><content type='html'>Following example I am trying to explain how we can request to a URL from our coding and read the Header content of the response.&lt;br /&gt;&lt;br /&gt;Create a web application and add a Textbox and a Button to Default.aspx and double click on the button and add following code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;        protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                //Create a object for HttpWebRequest using this request object we will&lt;br /&gt;                HttpWebRequest req = (HttpWebRequest)WebRequest.Create(TextBox1.Text);&lt;br /&gt;                //request a response from the URL&lt;br /&gt;                HttpWebResponse res = (HttpWebResponse)req.GetResponse();&lt;br /&gt;                //Reading all header content of response&lt;br /&gt;                for (int i = 0; i &lt; res.Headers.Count; i++)&lt;br /&gt;                {&lt;br /&gt;                    Response.Write(res.Headers.AllKeys[i] + " : " + res.Headers[i].ToString() + "&lt;br /&gt;");&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                //Catch if there are any exception&lt;br /&gt;                Response.Write(ex.Message);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Now we are ready with code, lets build, run and test&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;br /&gt;&lt;br /&gt;SatishKumar J&lt;br /&gt;Microsoft MVP(ASP.NET)&lt;br /&gt; Tags : HttpWebRequest, HttpWebResponse, Headers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-3777353896916932201?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/3777353896916932201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/httpwebrequest-and-httpwebresponse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3777353896916932201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/3777353896916932201'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/httpwebrequest-and-httpwebresponse.html' title='HttpWebRequest and HttpWebResponse'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-2338708582270121644</id><published>2009-03-25T22:05:00.000-07:00</published><updated>2009-04-05T05:40:22.768-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Logging .NET C# windows'/><title type='text'>Error Logging Windows Application VB.NET</title><content type='html'>&lt;span style="font-size: 85%; font-family: arial"&gt;Logging is very important for debugging exception at run time; normally logging will help us finding out problem in live environment.   &lt;br /&gt;    &lt;br /&gt;I am post here a logging function using VB.NET, Just add this function in you class and create a directory in C: called Logs.    &lt;br /&gt;&lt;/span&gt;&lt;em&gt;   &lt;br /&gt;&lt;span style="font-size: 85%; font-family: arial"&gt;&lt;font color="#0000ff"&gt;Public Sub Log(ByVal message As String)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ' Check whether log.txt is already present or not        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If Not File.Exists(&amp;quot;C:\Logs\log.txt&amp;quot;) Then        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'Create if not present        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim fs As FileStream = New FileStream(&amp;quot;C:\Logs\log.txt&amp;quot;,&amp;#160;&amp;#160; FileMode.OpenOrCreate, FileAccess.ReadWrite)        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim s As StreamWriter = New StreamWriter(fs)        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; s.Close()        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; s.Dispose()        &lt;br /&gt;fs.Close()        &lt;br /&gt;fs.Dispose()        &lt;br /&gt;End If        &lt;br /&gt;'Open log.txt in append mode to log errors        &lt;br /&gt;Dim fs1 As FileStream = New FileStream(&amp;quot;C:\Logs\log.txt&amp;quot;, FileMode.Append, FileAccess.Write)        &lt;br /&gt;Dim s1 As StreamWriter = New StreamWriter(fs1)        &lt;br /&gt;'Wrting a line with error message        &lt;br /&gt;s1.Write(&amp;quot;Message: &amp;quot; &amp;amp; message &amp;amp; vbCrLf)        &lt;br /&gt;'Logging the Date and Time of error        &lt;br /&gt;s1.Write(&amp;quot;Date/Time: &amp;quot; &amp;amp; DateTime.Now.ToString() &amp;amp; vbCrLf)        &lt;br /&gt;s1.Close()        &lt;br /&gt;s1.Dispose()        &lt;br /&gt;fs1.Close()        &lt;br /&gt;fs1.Dispose()        &lt;br /&gt;End Sub&lt;/font&gt;&lt;/span&gt;&lt;/em&gt;&lt;span style="font-size: 85%; font-family: arial"&gt;   &lt;br /&gt;    &lt;br /&gt;Now testing the above function    &lt;br /&gt;    &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: arial"&gt;&lt;span style="font-size: 85%"&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         &lt;br /&gt;Try          &lt;br /&gt;Dim j As Integer = 10          &lt;br /&gt;Dim i As Integer = 0          &lt;br /&gt;Dim k As Integer = j / i          &lt;br /&gt;Catch ex As Exception          &lt;br /&gt;Log(ex.Message)          &lt;br /&gt;End Try          &lt;br /&gt;End Sub&lt;/font&gt;&lt;/em&gt;      &lt;br /&gt;      &lt;br /&gt;Hope this helps      &lt;br /&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/1142861234663060713-2338708582270121644?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/2338708582270121644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/error-logging-windows-application-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2338708582270121644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2338708582270121644'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/error-logging-windows-application-vbnet.html' title='Error Logging Windows Application VB.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-1285954263010407845</id><published>2009-03-25T09:23:00.001-07:00</published><updated>2009-04-05T05:38:53.527-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET AJAX 3.5 Example'/><title type='text'>ASP.NET AJAX and Calendar Control</title><content type='html'>&lt;p&gt;Normally when we use calendar control in asp.net we see that calendar control occupies lot of space and selecting a date will cause a post back.&lt;/p&gt;  &lt;p&gt;To avoid that problem we can use AJAX to select a date from calendar control with out any page post back and hiding the calendar control will save lot of space.&lt;/p&gt;  &lt;p&gt;Now lets create a web application and add a script manager and a update panel control, now under update panel add text box, button and a calendar control as shown the below screen shot and make calendar control visible property to false&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/ScpafpC2h7I/AAAAAAAAA9s/Kkl7mhAgDcA/s1600-h/image%5B2%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="171" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Scpagtg99vI/AAAAAAAAA9w/6ftgNHpnIcc/image_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now lets write logic in .cs file for that double click on Button and add following code&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;Calendar1.Visible = true;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;and double click on calendar control and add following code&lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;em&gt;protected void Calendar1_SelectionChanged(object sender, EventArgs e)        &lt;br /&gt;{         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Calendar1.Visible = false;         &lt;br /&gt;}&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now we are ready with our code, lets run build and test.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/Scpahaqyt6I/AAAAAAAAA90/xFxJpxRBo4Q/s1600-h/image%5B5%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="183" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/ScpaingPM5I/AAAAAAAAA94/6yEjVJwGNAY/image_thumb%5B1%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-1285954263010407845?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/1285954263010407845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/aspnet-ajax-and-calendar-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/1285954263010407845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/1285954263010407845'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/aspnet-ajax-and-calendar-control.html' title='ASP.NET AJAX and Calendar Control'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eknxl1DkWrU/Scpagtg99vI/AAAAAAAAA9w/6ftgNHpnIcc/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-4226056367789782690</id><published>2009-03-25T08:53:00.001-07:00</published><updated>2009-04-05T05:39:06.870-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='News'/><title type='text'>ASP.NET MVC 1.0 is now Live</title><content type='html'>&lt;p&gt;ASP.NET MVC 1.0 is now live and you can download that from &lt;a title="http://go.microsoft.com/fwlink/?LinkId=" href="http://go.microsoft.com/fwlink/?LinkId=144444"&gt;http://go.microsoft.com/fwlink/?LinkId=144444&lt;/a&gt; and you can access the documentation from &lt;a href="http://go.microsoft.com/fwlink/?LinkId=145989"&gt;http://go.microsoft.com/fwlink/?LinkId=145989&lt;/a&gt;.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Tags : ASP.NET MCV, .NET C#, ASP.NET 3.5&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-4226056367789782690?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/4226056367789782690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/aspnet-mvc-10-is-now-live.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/4226056367789782690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/4226056367789782690'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/aspnet-mvc-10-is-now-live.html' title='ASP.NET MVC 1.0 is now Live'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-8917486664507476933</id><published>2009-03-19T08:15:00.001-07:00</published><updated>2009-03-19T08:15:43.071-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='News'/><title type='text'>Internet Explorer 8</title><content type='html'>&lt;p&gt;Latest version of Microsoft Internet Explorer v8.0 is released today, and you can download this at following location.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.microsoft.com/ie8" href="http://www.microsoft.com/ie8"&gt;http://www.microsoft.com/ie8&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Some of the new features are:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Accelerator&lt;/strong&gt; on the fly you can email, search with the selected content&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Web Slices&lt;/strong&gt; will fetch you latest information on your favourite sites which you browse frequently&lt;/p&gt;  &lt;p&gt;You can easily find content on the page with Smart search and find on page tool bar.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Smart Page Filters&lt;/strong&gt;&amp;#160; gives you more security from internet threats.&lt;/p&gt;  &lt;p&gt;It also include lot more features I feel it will be great experience browsing with IE8.&lt;/p&gt;  &lt;p&gt;Tags : Internet Explorer 8, IE 8, download Internet Explorer 8.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-8917486664507476933?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/8917486664507476933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/internet-explorer-8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/8917486664507476933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/8917486664507476933'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/internet-explorer-8.html' title='Internet Explorer 8'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-6259642325299429792</id><published>2009-03-17T09:54:00.001-07:00</published><updated>2009-03-17T09:54:17.351-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>System Driver Information : Windows Application</title><content type='html'>&lt;p&gt;&lt;strong&gt;System.Management&lt;/strong&gt; namespace has lot of classes which will help us in reading Operating system information, Driver information etc.&lt;/p&gt;  &lt;p&gt;Lets build a sample application which retrieves what all drivers installed in system.&lt;/p&gt;  &lt;p&gt;Create a Windows Application and add one Combo Box and One Button and One List box as shown in below screen shot&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/Sb_ViQLU-oI/AAAAAAAAA8c/bPTEeZ7vIis/s1600-h/image%5B5%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="244" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/Sb_Vjoa2sTI/AAAAAAAAA8g/ypDKjpeUiBo/image_thumb%5B1%5D.png?imgmax=800" width="169" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;What we are going to do here is, first load all the driver names in the Combo Box and after selecting any driver from Combo Box and click on Show Driver Details button we will show all details regarding that driver.&lt;/p&gt;  &lt;p&gt;For loading driver names into Combo Box initially we write following code in Form_Load event&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Sb_VlTtn2yI/AAAAAAAAA8k/yRLuq6JCDT8/s1600-h/image%5B8%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="123" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/Sb_VnOQMcMI/AAAAAAAAA8o/CpIV9HYDqb4/image_thumb%5B2%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Once a driver is selected and clicked on Show Driver Details button then we will show all the details of the driver in list box for that we write following code in Button1_Click event&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Sb_Vor_eb1I/AAAAAAAAA8s/N3F5EkAgOl4/s1600-h/image%5B11%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="159" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Sb_VqIP-PeI/AAAAAAAAA8w/e7bXT6i-Zp0/image_thumb%5B3%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with our code please build run and test&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/Sb_VsO4lHaI/AAAAAAAAA80/ke478qeesTQ/s1600-h/image%5B14%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="244" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/Sb_Vt4uenYI/AAAAAAAAA84/b0T5Zwpev9M/image_thumb%5B4%5D.png?imgmax=800" width="169" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;Tags: Driver Information, C#, .NET, Windows Application, System.Management&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-6259642325299429792?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/6259642325299429792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/system-driver-information-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6259642325299429792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6259642325299429792'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/system-driver-information-windows.html' title='System Driver Information : Windows Application'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eknxl1DkWrU/Sb_Vjoa2sTI/AAAAAAAAA8g/ypDKjpeUiBo/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-9158336813546824378</id><published>2009-03-16T08:34:00.001-07:00</published><updated>2009-03-16T08:46:52.411-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reports'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>External Images in .rdlc Reports : ASP.NET</title><content type='html'>&lt;p&gt;In this example I will explain how we can use external images in .rdlc reports.&lt;/p&gt;  &lt;p&gt;Create a Web Application.&lt;/p&gt;  &lt;p&gt;Right click on Project in Solution Explorer –&amp;gt; Add New Item – Select a .rdlc Report&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_eknxl1DkWrU/Sb5xM4V37jI/AAAAAAAAA7s/Ln27UP2mLJc/s1600-h/image%5B3%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="259" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Sb5xQrC1umI/AAAAAAAAA7w/G9MYkqSCb84/image_thumb%5B1%5D.png?imgmax=800" width="420" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now Drag and Drop a image control in Header section in the Report.rdlc&lt;/p&gt;  &lt;p&gt;Go to Report Menu in Visual Studio and Select Report Parameters –&amp;gt; and Add a parameter with name &lt;strong&gt;Path&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Sb5xSaknPEI/AAAAAAAAA70/slt3lBHpNh0/s1600-h/image%5B7%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="309" alt="image" src="http://lh5.ggpht.com/_eknxl1DkWrU/Sb5xVMre9dI/AAAAAAAAA74/on7hOee1wek/image_thumb%5B3%5D.png?imgmax=800" width="409" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we will set this path parameter to our image’s value property and provide the value at run time, select image and properties(F4) and set following values to Source and Value properties&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Source = External&lt;/strong&gt; and &lt;strong&gt;Value = !Path.value&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_eknxl1DkWrU/Sb5xW1E9eaI/AAAAAAAAA78/x85Sd9YDYQU/s1600-h/image%5B11%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="232" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Sb5xYr5NJyI/AAAAAAAAA8A/6_ObE15aKXU/image_thumb%5B5%5D.png?imgmax=800" width="420" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now create a Image folder in your solution and Add some images to that folder.&lt;/p&gt;  &lt;p&gt;As I am only concentration on showing images on the report in this example I am not loading any data on to the report.&lt;/p&gt;  &lt;p&gt;Now open Default.aspx page and add &lt;strong&gt;MicrosoftReportViewer&lt;/strong&gt; Control and set &lt;strong&gt;MicrosoftReportViewer&lt;/strong&gt; control source to Report1.rdlc&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Sb5xaT_cRmI/AAAAAAAAA8E/9X4d_qQVsxs/s1600-h/image%5B15%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="299" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Sb5xcG_3Q9I/AAAAAAAAA8I/NCUssgvYYdE/image_thumb%5B7%5D.png?imgmax=800" width="424" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we are ready with design part, &lt;/p&gt;  &lt;p&gt;One of the most important thing while displaying external images is to set EnableExternalImages perperty of MicrosoftReportViewer.LocalReport’s to True, this will allow us to show external images on the .rdlc reports&lt;/p&gt;  &lt;p&gt;And also we need to set the Path parameter value so that image will be displayed on the report for that we need to all following code to Page_Load event&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_eknxl1DkWrU/Sb5xdV_ozlI/AAAAAAAAA8M/H5qboUrm2mw/s1600-h/image%5B19%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="232" alt="image" src="http://lh4.ggpht.com/_eknxl1DkWrU/Sb5xfI0Bf7I/AAAAAAAAA8Q/seG5c36Yh84/image_thumb%5B9%5D.png?imgmax=800" width="452" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now we are ready with our code, just build and run and test&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_eknxl1DkWrU/Sb5xgor12EI/AAAAAAAAA8U/JEN9fGhHyTg/s1600-h/image%5B27%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="320" alt="image" src="http://lh6.ggpht.com/_eknxl1DkWrU/Sb5xhzVkPtI/AAAAAAAAA8Y/kj_9OGojd7Q/image_thumb%5B13%5D.png?imgmax=800" width="246" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;Tags : .rdlc report, external Images, ASP.NET&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-9158336813546824378?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/9158336813546824378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/external-images-in-rdlc-reports-aspnet.html#comment-form' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/9158336813546824378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/9158336813546824378'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/external-images-in-rdlc-reports-aspnet.html' title='External Images in .rdlc Reports : ASP.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eknxl1DkWrU/Sb5xQrC1umI/AAAAAAAAA7w/G9MYkqSCb84/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-2964712522843288953</id><published>2009-03-16T07:18:00.001-07:00</published><updated>2009-03-16T07:18:31.896-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><title type='text'>Start date and End date of Current Month</title><content type='html'>&lt;p&gt;Following code snippet is will help you find our starting date and ending date of current month.&lt;/p&gt;  &lt;blockquote&gt;   &lt;table cellspacing="0" cellpadding="2" width="512" border="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="510"&gt;           &lt;p&gt;&lt;font face="verd" color="#0000ff"&gt;&lt;em&gt;Dim Year As Integer = DateTime.Today.Year                 &lt;br /&gt;Dim Month As Integer = DateTime.Today.Month                  &lt;br /&gt;Dim stDate As DateTime                  &lt;br /&gt;stDate = New DateTime(Year, Month, 1)                  &lt;br /&gt;Dim endDate As DateTime                  &lt;br /&gt;endDate = New DateTime(Year, Month, DateTime.DaysInMonth(Year, Month))                  &lt;br /&gt;MessageBox.Show(stDate.ToString(&amp;quot;dd/MM/yyyy&amp;quot;))                  &lt;br /&gt;MessageBox.Show(endDate.ToString(&amp;quot;dd/MM/yyyy&amp;quot;))&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/blockquote&gt;  &lt;p&gt;In the above code I have taken Current year in &lt;strong&gt;Year&lt;/strong&gt; variable current month in &lt;strong&gt;Month.&lt;/strong&gt; For start date of any month will be 1 so we can directly give Year, Month, 1 as parameters to create start date. For end date we have to get the current month end date for that we can use in built function DayInMonth and create end date. &lt;/p&gt;  &lt;p&gt;Hope this helps &lt;/p&gt;  &lt;p&gt;Tags : Start Date, End Date of Current Month in VB.NET&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-2964712522843288953?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/2964712522843288953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/start-date-and-end-date-of-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2964712522843288953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/2964712522843288953'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/start-date-and-end-date-of-current.html' title='Start date and End date of Current Month'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5627725022541657885</id><published>2009-03-11T21:47:00.000-07:00</published><updated>2009-03-11T21:51:58.670-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kobe'/><category scheme='http://www.blogger.com/atom/ns#' term='Web 2.0'/><title type='text'>Kobe : Microsoft Implementation of Web 2.0</title><content type='html'>Web 2.0 much discussed term nowadays; what is Web 2.0 lets us first define what Web 1.0 and then come to Web 2.0.&lt;br /&gt;&lt;br /&gt;Web 1.0: Normal web applications which provide some information and very minimal user interaction with the application, this is server centric&lt;br /&gt;&lt;br /&gt;Web 2.0: A rich Web application which provides more interactions with user, and user can customize his content etc, and this is user centric. &lt;br /&gt;One of the examples for Web 2.0 is twitter.com, in this web site you can share photos, customize view etc.&lt;br /&gt;&lt;br /&gt;Microsoft has come with some starter kit for implementing Web 2.0 applications and it is called &lt;strong&gt;Kobe&lt;/strong&gt;. &lt;br /&gt;&lt;br /&gt;They are providing some good information how to plan and build Web 2.0 application, you can find more details, examples and some videos at following link. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/architecture/bb194897.aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/architecture/bb194897.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5627725022541657885?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5627725022541657885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/kobe-microsoft-implementation-of-web-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5627725022541657885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5627725022541657885'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/kobe-microsoft-implementation-of-web-20.html' title='Kobe : Microsoft Implementation of Web 2.0'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-4485130891740475107</id><published>2009-03-02T20:42:00.000-08:00</published><updated>2009-03-07T09:15:50.914-08:00</updated><title type='text'>Sync Services in SQL Server Compact Edition 3.5 Visual Studio 2008</title><content type='html'>&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;   &lt;div align="justify"&gt;     &lt;br /&gt;Sync Services in SQL Server Compact Edition 3.5 Visual Studio 2008      &lt;br /&gt;      &lt;br /&gt;Visual Studio 2008 has a powerful feature Sync Services for SQL Server Compact Edition, which will allow user to sync data from client to server and vice versa, this will make job easy for developer who are developing smart device application or window application with local database.      &lt;br /&gt;Modify local database as and when you needed and updating with server database is far easier than earlier merge applications.      &lt;br /&gt;      &lt;br /&gt;Let us build a sample application for demo the Sync Services in SQL CE 3.5      &lt;br /&gt;      &lt;br /&gt;Create a windows application and a new item and select LocalDataCache type, this LocalDataCache is the local database file holds the local copy of your server database      &lt;br /&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p align="justify"&gt;&lt;a href="http://2.bp.blogspot.com/_eknxl1DkWrU/SazBZC5LRGI/AAAAAAAAA5g/KHl2vCy2MYc/s1600-h/AddFile.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308830696780547170" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 246px; text-align: center" alt="" src="http://2.bp.blogspot.com/_eknxl1DkWrU/SazBZC5LRGI/AAAAAAAAA5g/KHl2vCy2MYc/s400/AddFile.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Once you add LocalDataCache file you will see following window on your screen to select particular tables from the server database which you want to keep at client side. Here you need to select the Server connection by clicking new and client databse(.sdf) file is automatically created by VS2008 for you    &lt;br /&gt;    &lt;br /&gt;Here I am taking the Northwind database for this example and I am selecting Employees table for demo    &lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_eknxl1DkWrU/SazB0LGhGtI/AAAAAAAAA5o/p2q1_AFR2aE/s1600-h/Configure1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308831162840455890" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 297px; text-align: center" alt="" src="http://4.bp.blogspot.com/_eknxl1DkWrU/SazB0LGhGtI/AAAAAAAAA5o/p2q1_AFR2aE/s400/Configure1.JPG" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;Now click on Add button at below to select specific tables    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SazCKTNfKXI/AAAAAAAAA5w/oJWYsPbdWps/s1600-h/Configure2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308831542974294386" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 297px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SazCKTNfKXI/AAAAAAAAA5w/oJWYsPbdWps/s400/Configure2.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Once you have selected the tables just click on the Show Code Example and copy the code into clipboard this code we will use for Synching the data.    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SazChKsQ4qI/AAAAAAAAA54/_2-xboJ7hxs/s1600-h/CodeExample.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308831935824454306" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 151px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SazChKsQ4qI/AAAAAAAAA54/_2-xboJ7hxs/s400/CodeExample.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Now we are ready with the back end part, creating a local database etc.    &lt;br /&gt;    &lt;br /&gt;Now let’s design a form to demonstrate the synching mechanism    &lt;br /&gt;Here I am adding 2 DataGridViews one is for local database and second is for server database.    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SazC4UqT6kI/AAAAAAAAA6A/xJb90TN2Mxc/s1600-h/AddDataSource11.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308832333637610050" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 223px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SazC4UqT6kI/AAAAAAAAA6A/xJb90TN2Mxc/s400/AddDataSource11.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Click on Add Project Data source    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_eknxl1DkWrU/SazC4ffM_8I/AAAAAAAAA6I/7q0HTOOdgFY/s1600-h/AddDataSource12.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308832336543809474" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 316px; text-align: center" alt="" src="http://4.bp.blogspot.com/_eknxl1DkWrU/SazC4ffM_8I/AAAAAAAAA6I/7q0HTOOdgFY/s400/AddDataSource12.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Select Database click on Next    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SazC4Qd_rSI/AAAAAAAAA6Q/yKG1UjUc4AI/s1600-h/AddDataSource13.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308832332512210210" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 317px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SazC4Qd_rSI/AAAAAAAAA6Q/yKG1UjUc4AI/s400/AddDataSource13.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Select Client Connection and Click Next    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SazC4nvaLCI/AAAAAAAAA6Y/K1Bzpdhq6EA/s1600-h/AddDataSource14.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308832338759265314" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 317px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SazC4nvaLCI/AAAAAAAAA6Y/K1Bzpdhq6EA/s400/AddDataSource14.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Click on Finish.    &lt;br /&gt;    &lt;br /&gt;Now we will add data source for second datagridview and it will be server database data.    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SazC4n0iP9I/AAAAAAAAA6g/CEA_StuYsqM/s1600-h/AddDataSource21.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308832338780766162" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 239px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SazC4n0iP9I/AAAAAAAAA6g/CEA_StuYsqM/s400/AddDataSource21.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Add Project Data Source    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_eknxl1DkWrU/SazDfaN4m_I/AAAAAAAAA6o/h_TOt5TUqNQ/s1600-h/AddDataSource22.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308833005143890930" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 314px; text-align: center" alt="" src="http://4.bp.blogspot.com/_eknxl1DkWrU/SazDfaN4m_I/AAAAAAAAA6o/h_TOt5TUqNQ/s400/AddDataSource22.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Click on Next    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_eknxl1DkWrU/SazDflG49LI/AAAAAAAAA6w/Ok9_7_WM4XA/s1600-h/AddDataSource23.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308833008067343538" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 316px; text-align: center" alt="" src="http://1.bp.blogspot.com/_eknxl1DkWrU/SazDflG49LI/AAAAAAAAA6w/Ok9_7_WM4XA/s400/AddDataSource23.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Select Server Data connection and Click next    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SazDf4td-qI/AAAAAAAAA64/9tFWQgsVnG8/s1600-h/AddDataSource24.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308833013329427106" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 316px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SazDf4td-qI/AAAAAAAAA64/9tFWQgsVnG8/s400/AddDataSource24.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;Select the employee table and click finish.    &lt;br /&gt;    &lt;br /&gt;Now add 3 buttons showed in below screen shot    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/SazEzTn3MhI/AAAAAAAAA7A/TQ-yIwVTrVY/s1600-h/FormDesign.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308834446482813458" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 290px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/SazEzTn3MhI/AAAAAAAAA7A/TQ-yIwVTrVY/s400/FormDesign.JPG" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;    &lt;br /&gt;Double click on Update Local Data and add following code, this code updates the data in the local database    &lt;br /&gt;    &lt;br /&gt;&lt;font color="#0000ff"&gt;private void btnLocalUpdate_Click(object sender, EventArgs e)     &lt;br /&gt;{      &lt;br /&gt;employeesTableAdapter.Update(this.northwindDataSet.Employees);      &lt;br /&gt;}      &lt;br /&gt;&lt;/font&gt;    &lt;br /&gt;Double click on Update Server Data and add following code, this code updates the data in the Server database&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#0000ff"&gt;private void btnServerUpdate_Click(object sender, EventArgs e)     &lt;br /&gt;{      &lt;br /&gt;employeesTableAdapter1.Update(this.northwindDataSet1.Employees);      &lt;br /&gt;}&lt;/font&gt;    &lt;br /&gt;    &lt;br /&gt;Now we are updating Local and Server database individually, now we will write a code that will sync both the databases, now double click on Sync data and add following code&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#0000ff"&gt;private void btnSync_Click(object sender, EventArgs e)     &lt;br /&gt;{      &lt;br /&gt;// Call SyncAgent.Synchronize() to initiate the synchronization process.      &lt;br /&gt;// Synchronization only updates the local database, not your project’s data source.      &lt;br /&gt;LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();      &lt;br /&gt;Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();      &lt;br /&gt;      &lt;br /&gt;this.northwindDataSet.Merge(this.employeesTableAdapter.GetData());      &lt;br /&gt;// TODO: Reload your project data source from the local database (for example, call the TableAdapter.Fill method).      &lt;br /&gt;// TODO: This line of code loads data into the 'northwindDataSet1.Employees' table. You can move, or remove it, as needed.      &lt;br /&gt;this.employeesTableAdapter1.Fill(this.northwindDataSet1.Employees);      &lt;br /&gt;// TODO: This line of code loads data into the 'northwindDataSet.Employees' table. You can move, or remove it, as needed.      &lt;br /&gt;this.employeesTableAdapter.Fill(this.northwindDataSet.Employees);      &lt;br /&gt;}      &lt;br /&gt;&lt;/font&gt;    &lt;br /&gt;To sync data bio directional that mean updating from client to server and vise versa we need to add a line of code, now open the LocalDataCache1.cs add following line in OnInitialized    &lt;br /&gt;    &lt;br /&gt;&lt;font color="#0000ff"&gt;this.Employees.SyncDirection= Microsoft.Synchronization.Data.SyncDirection.Bidirectional;     &lt;br /&gt;&lt;/font&gt;    &lt;br /&gt;Now we are ready with our example just run the application and modify data in any one the grid and update it and click on Sync Data and see the out put.    &lt;br /&gt;&lt;/p&gt; &lt;a href="http://4.bp.blogspot.com/_eknxl1DkWrU/SazEzp7LLQI/AAAAAAAAA7I/pjWUVEh8oXk/s1600-h/Output.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308834452469394690" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 257px; text-align: center" alt="" src="http://4.bp.blogspot.com/_eknxl1DkWrU/SazEzp7LLQI/AAAAAAAAA7I/pjWUVEh8oXk/s400/Output.JPG" border="0" /&gt;&lt;/a&gt;  &lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;Hope this helps.     &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-4485130891740475107?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/4485130891740475107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/sync-services-in-sql-server-compact.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/4485130891740475107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/4485130891740475107'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/03/sync-services-in-sql-server-compact.html' title='Sync Services in SQL Server Compact Edition 3.5 Visual Studio 2008'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_eknxl1DkWrU/SazBZC5LRGI/AAAAAAAAA5g/KHl2vCy2MYc/s72-c/AddFile.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-6590905243995890924</id><published>2009-02-27T01:53:00.000-08:00</published><updated>2009-03-02T07:27:06.303-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET AJAX 3.5 Example'/><title type='text'>ASP.NET AJAX 3.5 Example</title><content type='html'>&lt;div&gt;`In this example I am Using AJAX to show how you can display data using AJAX.    &lt;br /&gt;    &lt;br /&gt;This will work very fast and you will see there is not page reload is occurring     &lt;br /&gt;    &lt;br /&gt;Create a Web Application and modify Default.aspx html content     &lt;br /&gt;I am adding Script manager control and a Update Panel control, Under Update panel control add 2 labels and 2 dropdownlist control and gridview like below     &lt;br /&gt;&lt;/div&gt;  &lt;div&gt;   &lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_eknxl1DkWrU/Sae6kalBX1I/AAAAAAAAA5A/Q10Vcq8GtEM/s1600-h/html.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5307415820652076882" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 259px; text-align: center" alt="" src="http://4.bp.blogspot.com/_eknxl1DkWrU/Sae6kalBX1I/AAAAAAAAA5A/Q10Vcq8GtEM/s400/html.JPG" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;Once Modify Default.aspx, open Default.aspx.cs and modify the Page_Load and add following code.    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/Sae6wV9UITI/AAAAAAAAA5I/oUkz53XFYQI/s1600-h/pageload.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5307416025570222386" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 272px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/Sae6wV9UITI/AAAAAAAAA5I/oUkz53XFYQI/s400/pageload.JPG" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; Now we will add code to fetch the Orders by particular Employee, for that we need write code in DropDownList1_SelectedIndexChanged event, please add following code   &lt;br /&gt;  &lt;br /&gt;  &lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/Sae75VjMJoI/AAAAAAAAA5Y/olD8gwDpCjg/s1600-h/DD2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5307417279591097986" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 220px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/Sae75VjMJoI/AAAAAAAAA5Y/olD8gwDpCjg/s400/DD2.JPG" border="0" /&gt;&lt;/a&gt;&lt;/div&gt; Now we will fetch the order details of selected order number for that we need to add the following code in DropDownList2_SelectedIndexChanged event   &lt;br /&gt;  &lt;br /&gt;  &lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_eknxl1DkWrU/Sae7qUEcRSI/AAAAAAAAA5Q/xg0kdNuhcyA/s1600-h/DDL1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5307417021495657762" style="display: block; margin: 0px auto 10px; width: 400px; cursor: hand; height: 281px; text-align: center" alt="" src="http://3.bp.blogspot.com/_eknxl1DkWrU/Sae7qUEcRSI/AAAAAAAAA5Q/xg0kdNuhcyA/s400/DDL1.JPG" border="0" /&gt;&lt;/a&gt;&lt;/div&gt; Now we are ready with over code, just build, run and test   &lt;br /&gt;  &lt;br /&gt;Hope this help you.     &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-6590905243995890924?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/6590905243995890924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/02/aspnet-ajax-35-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6590905243995890924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6590905243995890924'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/02/aspnet-ajax-35-example.html' title='ASP.NET AJAX 3.5 Example'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_eknxl1DkWrU/Sae6kalBX1I/AAAAAAAAA5A/Q10Vcq8GtEM/s72-c/html.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-5840480273221210819</id><published>2009-02-26T20:25:00.000-08:00</published><updated>2009-02-26T20:33:00.008-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL CE 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='Sync Services'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Compact 3.5 Sync Services'/><title type='text'>SQL Server Compact 3.5 Sync Services</title><content type='html'>SQL Server Compact 3.5 Sync Services is introduced in SQL CF 3.5 which is very useful in storing offline data in our application and synchronising the same with server as and when required, previous to SQL CE 3.5 we used do this operation using Merge application however we were not having much flexibility with merge applications.&lt;br /&gt;&lt;br /&gt;When you ported your application on any mobile device or compact device which will have limited network connectivity, you can use this SQL Server Compact Sync services to store your data offline in your application and as and when your get the Connectivity you can sync data with server database, this Sync services has all the in-built facilities to Sync your data properly&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-5840480273221210819?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/5840480273221210819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/02/sql-server-compact-35-sync-services.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5840480273221210819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/5840480273221210819'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/02/sql-server-compact-35-sync-services.html' title='SQL Server Compact 3.5 Sync Services'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-6406686756050493245</id><published>2009-02-25T20:57:00.000-08:00</published><updated>2009-02-25T21:31:33.117-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Number of Characters Word'/><title type='text'>Counting Characters in Word Document Using VB.NET</title><content type='html'>Following function is used to count the number of character in a Word document, parameters are file name and optional include number of lines also.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_eknxl1DkWrU/SaYobUaTiMI/AAAAAAAAA44/suZq_r9h0bM/s1600-h/NoOfCharsInWord.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5306973660703328450" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 230px" alt="" src="http://1.bp.blogspot.com/_eknxl1DkWrU/SaYobUaTiMI/AAAAAAAAA44/suZq_r9h0bM/s400/NoOfCharsInWord.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;SatishKumar J&lt;br /&gt;Microsoft MVP(ASP.NET)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-6406686756050493245?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/6406686756050493245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/02/counting-characters-in-word-document.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6406686756050493245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/6406686756050493245'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/02/counting-characters-in-word-document.html' title='Counting Characters in Word Document Using VB.NET'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_eknxl1DkWrU/SaYobUaTiMI/AAAAAAAAA44/suZq_r9h0bM/s72-c/NoOfCharsInWord.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1142861234663060713.post-8286369333101611961</id><published>2009-02-25T20:37:00.000-08:00</published><updated>2009-02-25T20:41:06.306-08:00</updated><title type='text'>.NET Developers blog</title><content type='html'>Hi All,&lt;br /&gt;&lt;br /&gt;Welcome to my blog here I will be blogging all about .NET.&lt;br /&gt;&lt;br /&gt;Thanks for visiting, visit again.&lt;br /&gt;&lt;br /&gt;SatishKumar J&lt;br /&gt;Microsoft Most Valuable Professional (ASP.NET)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1142861234663060713-8286369333101611961?l=satishjdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishjdotnet.blogspot.com/feeds/8286369333101611961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://satishjdotnet.blogspot.com/2009/02/net-developers-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/8286369333101611961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1142861234663060713/posts/default/8286369333101611961'/><link rel='alternate' type='text/html' href='http://satishjdotnet.blogspot.com/2009/02/net-developers-blog.html' title='.NET Developers blog'/><author><name>Satish Kumar J</name><uri>http://www.blogger.com/profile/14970973554155878648</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
