Thursday, May 21, 2009
Usefull Firefox Addons for Developement
FireBug
I hope you will be using this.Inspect the page on the fly and change the styles and see the output immdly.
Pinger
Ping all the links in the page and will show the statistics of broken links.
Firesizer
Resize the browser window to the dimensions used by the enduser.Mainly used for tesiting in the wide screen machines.
IE Tab
Render a page in FireFox with IE rendering engine.
ColorZilla
Pick a color on the fly
Measure It
Draw out a ruler to get the pixel width and height of any elements
ScreenGrab
Take the screenshot of the webpage with scrolling.
Y'Slow
Used to test the performance of a site and tuneup things as per their suggestions.
Wednesday, April 15, 2009
SQL CE with ASP .NET Application
{
AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);
string connectionString = @"Data Source=|DataDirectory|\Northwind.sdf";
Northwind nw = new Northwind(connectionString);
var DataSource = nw.Orders.Skip(0).Take(100).Select(o => o);
}
<add assembly="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91">
</assemblies >
Monday, April 13, 2009
SQL CE db creation with C#
- Check for database available or not if not create the database through SqlCeEngine object as below
if (!File.Exists(\\My Documents\\EmpDB.sdf))
{
SqlCeEngine empEngine = new SqlCeEngine("Data Source = \\My Documents\\EmpDB.sdf");
empEngine.CreateDatabase();}
Note : the database file name must have .sdf extension - After create the database is created next step is to create the required tables
SqlCeConnection empCon;
SqlCeCommand empCom;
empCon = new SqlCeConnection("Data Source = \\My Documents\\EmpDB.sdf");
empCon.Open();
empCom = empCon.CreateCommand();
string strQuery = "CREATE TABLE Employee (EmpID int IDENTITY(0,1) PRIMARY KEY,EmpName nvarchar(10),Salary int)";
empCom.CommandText=strQuery;
empCom.ExecuteNonQuery();
This code snippet create a table with three columns ( empid,emp name & salary ) - Once you setup the database then further operations are store or fetch data , ii can be done through SqlCeDataReader as below
string strQuery = "SELECT * FROM Employee ORDER By EmpName ASC";
empCom.CommandText = strQuery;
SqlCeDataReader empReader = empCom.ExecuteReader();
you can use the code and fill the datas from the existing MDF to CE.
Thursday, October 30, 2008
Bank that credits your account each morning with Rs 86,400
Imagine there is a bank that credits your account each morning with Rs 86,400. It carries over no balance from day to day; allows you to keep no cash balance; every night deletes whatever part of the balance you failed to use during the day. What would you do with such an account Draw out every penny, of course!!!
Each day it opens a new account for you. Each night it burns the records of the day. If you fail to use the day’s deposits, the loss is yours. There is no going back. There is no drawing against tomorrow. You must live in the present -on today’s deposits. Invest it so as to get from it the utmost in health, happiness and success!
The clock is running. Make the most of today!! And make it a great week ahead!!
Thursday, October 23, 2008
Visual Studio Tips & Tricks that Every Developer Should Know
Tips & Tricks that Every Developer Should Know
In this blog entry, I list the essential tips and tricks that every developer who uses Visual Studio 2008 should know. I wanted to keep this list brief. I also wanted to focus on only those tips and tricks that I use on a daily basis. Almost all of these tips and tricks are just as useful regardless of whether you are building an ASP.NET Web Forms or ASP.NET MVC application.
Tip #1 – You don’t need to select a line to copy or delete it
I always cringe whenever I see someone select an entire line of code in the Visual Studio code editor before copying the line or deleting the line (see Figure 1). You don’t need to do this.
Figure 1
If you want to copy a line of code then you can simply press CTRL-c to copy the line and press CTRL-v to paste the line. If you want to delete a line, don’t select it first, just press CTRL-x. You’ll be surprised how much time this one tip will save you.
Tip #2 – You can add a namespace automatically by pressing CTRL-.
In the old days, before Visual Studio 2008, if you used a class in your code that was not a member of any of the existing namespaces imported in your code then you had no choice but to look up the class in the documentation and enter a using statement to import the new namespace.
Visual Studio 2008 is smart enough to import namespaces for you automatically. If you type the name of a class that inhabits a namespace that has not been imported then Visual Studio displays a red bar beneath the class in the editor (see Figure 2). You can press CTRL-. to display a dialog box for picking the right namespace to import. Finally, just press the ENTER key to select a namespace (see Figure 3).
Figure 2
Figure 3
Tip #3 – Never create properties by hand
Never type property declarations by hand. It takes forever! Instead, just type prop + TAB + TAB. When you type prop + TAB + TAB, you get a code snippet (template) for entering a property. Use TAB to move between the template parameters. Press the ENTER key when you are finished creating the property (see Figure 4). This tip has saved me from many days of tedious property typing.
Figure 4
Tip #4 – You can remove and sort unnecessary using statements
Whenever I finish creating a class, I always clean up the list of using statements that appear at the top of the class file. I like to remove any unused using statements to reduce the amount of visual clutter in my classes. You can remove using statements that are not required by your code by right-clicking the top of your code file, selecting the menu option Organize Usings, and select Remove and Sort.
Figure 5
Tip #5 – Use CTRL-k+c to comment out code
If you need to temporarily disable a block of code, or a section of an ASP.NET page, then you can comment out the region by pressing CTRL-k+c. I always do this when I want to rewrite an existing section of code, but I am afraid to delete the old code before writing the new code.
For example, Figure 6 illustrates commented out code in the code editor.
Figure 6
You can use the very same key combination to comment out code almost anywhere. For example, you can comment out code in ASP.NET pages, web.config files, and JavaScript files (see Figure 7).
Figure 7
You can perform the opposite operation, and uncomment out code, by using the keyboard combination CTRL-k+u.
Tip #6 – You can close all documents except the current one
After working in Visual Studio for an extended period of time, I end up with a lot of open documents. I like to quickly switch between open documents by hitting the keyboard combination CTRL-TAB (you can also use CTRL-TAB to shift focus to different tool windows). If you have too many documents open, using CTRL-TAB becomes more difficult because you must hunt through the set of open documents.
There are two ways that you can close open documents. You can use the menu option Window, Close All Documents. Better yet, you can right click a tab that corresponds to an open document and select the menu option Close All But This. Selecting this latter option closes all open documents except the document corresponding to the tab (see Figure 8).
Figure 8
Tip #7 – You can open a database by double-clicking the database file in App_Data
After you add a user instance of a SQL Express database to a project (a RANU database), you can quickly connect to the database by double-clicking the .mdf file in the App_Data folder. Double-clicking the database opens the Server Explorer/Database Explorer window and expands the objects in the database automatically.
Tip #8 – You can copy a file or folder into a project by dragging and dropping
I’m always composing new Visual Studio projects from bits and pieces of previous Visual Studio projects. For example, I might need to add a folder from a previous project or a set of files. You can add existing files to Visual Studio by right-clicking in the Solution Explorer window and selecting the menu option Add, Existing Item. But, this method of adding files is slow. Furthermore, you can’t add folders using this method.
The best method of adding files and folders to Visual Studio project is to just drag the files or folder into the Solution Explorer window (or copy and paste the files or folder). For example, I am constantly adding my MoviesDB.mdf movies SQL Express database to new projects. I keep this file on my desktop and drag it into the App_Data folder whenever I need the database in a new Visual Studio project.
Tip #9 – Use CTRL-SPACE to perform statement completion
This tip is particularly relevant for developers who build applications by using test-driven development. When doing test-driven development, you write a unit test first and then write code that satisfies the unit test. When writing the unit test, you often have to fight with statement auto-completion.
There is an easy solution to this problem. Disable automatic statement completion by selecting Tools, Options, Text Editor, All Languages and uncheck the Auto list members checkbox (see Figure 9).
Figure 9
After you disable auto list members, you can still display suggestions for statement completion by using the keyboard combination CTRL-SPACE.
Tip #10 – Add new items by pressing CTRL-N or CTRL-SHIFT+A
In general, using the mouse to perform an action in Visual Studio is slower than entering a keyboard combination. The fastest way to add a new item into a Visual Studio project is to hit the keyboard combination CTRL-n or the keyboard combination CTRL-SHIFT+A. The first keyboard combination works in ASP.NET Websites and the second keyboard combination works in both Website and ASP.NET MVC Web Application projects.
This keyboard combination opens the Add New Item dialog box (see Figure 10).
Figure 10
You can use the TAB and arrow keys to select an item from the dialog box and navigate to the Open button. Press the ENTER key to invoke the Open button.
Tip #11 – You don’t need to type file extensions when adding a file
This tip is related to the previous one. After using the TAB key to navigate to the Name textbox in the Add New Item dialog box, you can enter the name of the new item. When typing the name of a new item, you don’t need to include the file extension. Visual Studio can determine the file extension from the selected template.
For example, when adding a new Web Form named MyPage.aspx, you can simply type MyPage. When adding a new Master Page named Site.master, you can simply type Site.
You might think that avoiding typing a couple of characters would not matter. But, if you add dozens of files to a Visual Studio project, the number of characters that you can avoid typing quickly adds up.
Source: Stephen Walther(ASP.Net)
Tuesday, October 21, 2008
CTRL+ C Hack Be Careful
Script Language="JavaScript" var content = clipboardData.getData("Text"); alert(content);
To avoid do the following:
- Go to internet options->security
- Press custom level
- In the security settings, select disable under Allow paste operations via script.
source: http://www.sourcecodesworld.com/special/clipboard.asp
Thursday, October 16, 2008
About Me

