Geeks With Blogs

News

Agha Usman Ahmed JILAWATAN .net
Getting started with Unit Testing in C#
Introduction: In this post, I will explain you how can we write a unit test in c#. It is a basic guideline for those who wants a quick start. Unit testing is an integral part of any software that is developed. It is an advantage which most of us are either not aware of or we are neglecting it. It actually helps a developer to write error free code. To write unit test, we will first install a unit-testing framework. About Unit-Testing Framework: Well, Unit-Testing Frameworks are useful to simplify ......

Posted On Friday, August 7, 2009 7:08 AM

Get Countries Name in .Net
Introduction: In this post, I will explain you how can we get the countries name filled in any collection using .net without using any database. It is a regular task, which we all as developers did some past day but the difference is we used database table or xml file to hold the country names. But .net framework provide us with all the countries information in Globalization namespace. So, here is the code for that Dictionary<string,string... objDic = new Dictionary<string,string... foreach ......

Posted On Sunday, July 26, 2009 1:43 AM

CodeGain.com .net Community Portal
A guy named RRaveen has setup a .net community portal named CodeGain and located on http://www.codegain.com. Yet the portal is still in process but the content which he has posted is really useful and in fact it really help me in some places. The best part about this portal is, it is not .net or asp.net specific. You will find articles on desktop applications, Java, Oracle etc. Previously, RRaveen had also written some articles on HighOnCoding.com and is active .net community so he is on a great ......

Posted On Tuesday, July 21, 2009 7:47 AM

Show images on Grid View from File Stream
Background : In my last post about SQL Server 2008 new feature File Stream (Saving and Retrieving File Using FileStream SQL Server 2008), we did an example of saving an image to the file stream and then retrieve it back and make it available for download. The result of that example looks like as below. But, one has to press the button to download the image file. One of my blog reader raise a point that he wants to display the same image instead of Get File button which is going to download. Introduction ......

Posted On Tuesday, May 26, 2009 2:18 AM

Custom Paging in Grid view
So, it takes too long for me to write this post. even though I completed the coding stuff a week back but it is really hard to manage time these days. In this post, I will explain and demonstrate you how to create custom paging in Grid view control. Paging which works like the Google Paging. Let me elaborate more, say for example you have a record set of 500 items and you want to display 10 items per page. Now what happen to the pages numbers. Either you use the default with “..” sign after 10th ......

Posted On Monday, May 18, 2009 9:17 PM

Datatable to JSON
In this post I will explain you, how can we serialize Datatable to JSON. So that, it can easily pass to JavaScript to get the AJAX done. First of all fill a Datatable with some results. DataTable dt = new DataTable(); SqlConnection objSqlCon = new SqlConnection(System.Config... objSqlCon.Open(); SqlDataAdapter objSqlDa = new SqlDataAdapter("select * from Production.Product", objSqlCon); objSqlDa.Fill(dt); Now ......

Posted On Saturday, May 16, 2009 4:52 PM

Authenticated File Access using HTTP Handler.
In this post I will explain you how authenticate the request directly coming to access a file that is downloadable. some thing like *.pdf or *.zip. Mostly, people make it working by creating an *.aspx page and then write binary of that file in Response.WriteFile. So, user will have no idea where the file is coming from. now this is the fair approach but what if somebody, somehow know the path of downloadable files. So, to stop the un authenticated access to our files, we will first create a session ......

Posted On Friday, May 8, 2009 2:20 AM

Disable Special Keys in Win App C#
Today, when I was planning to write an article on Grid View. I got a message from a very good friend of mine who is asking to disable the special keys(Windows Keys) in his application. When I start researching on it, I was thinking that it can be done using e.KeyChar but unfortunately, it is not showing any information about windows keys. So in this post I will explain you, how can we disable the special keys (in our case windows keys) in C# Application. 1. Crete a c# windows application project ......

Posted On Sunday, April 26, 2009 11:32 PM

How to pass parameters to the dynamically added user control
In this post, I will explain how you can pass parameter to the dynamically added (from code behind) User Control. Most of you might aware of how we can achieve this in web application project. Following is the code for that 1: Dim objCon As Control = Page.LoadControl("~/Control... 2: Ctype(objCon,MyControl).Pro... = "Test" 3: Ctype(objCon,MyControl).Pro... = "USAM" 4: MyPanel.Controls.add(objCon) Now what if you have a web site project which does not have the pre-compiled ......

Posted On Wednesday, April 15, 2009 8:36 PM

Saving and Retrieving File Using FileStream SQL Server 2008
FileStream data type is a very important feature of SQL Server 2008 and gradually getting popular amongst developer for it’s feasibility. And in the past few days specially after “Configure SQL Server 2008 for File Stream” post. I received several feedbacks regarding the usage of FileStream with Ado.net and Frankly there is not much stuff available on Google for this topic. In this post, I will guide you to use FileStream Data type in Ado.net. But before we start make sure you have configure your ......

Posted On Monday, March 16, 2009 1:10 AM

Copyright © Agha Usman Ahmed | Powered by: GeeksWithBlogs.net