Tuesday, May 26, 2009

Add styles, stylesheets to page header ASP.Net 2.0

To change a page's title:

this.Header.Title = "This is the new page title.";

To add a style attribute for the page:

Style style = new Style();
style.ForeColor = System.Drawing.Color.Navy;
style.BackColor = System.Drawing.Color.LightGray;

// Add the style to the header for the body of the page
this.Header.StyleSheet.CreateStyleRule(style, null, "body");

To add a stylesheet to :

HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("href", "~/newstyle.css");
this.Header.Controls.Add(link);

LINQ Framework Design Guidelines

here is a very good resource on LINQ design guidelines that you can read more on it here:

LINQ Framework Design Guidelines (http://blogs.msdn.com/mirceat/archive/2008/03/13/linq-framework-design-guidelines.aspx)

Tuesday, May 19, 2009

Introducing LINQ Tutorial

http://msmvps.com/blogs/abu/archive/2008/06/30/introducing-linq-tutorial.aspx

  • Part 1: Introduction to LINQ to SQL
  • Part 2: Defining our Data Model Classes
  • Part 3: Querying our Database
  • Part 4: Updating our Database
  • Part 5: Binding UI using the ASP:LinqDataSource Control
  • Part 6: Retrieving Data Using Stored Procedures
  • Part 7: Updating our Database using Stored Procedures
  • Part 8: Executing Custom SQL Expressions
  • Part 9: Using a Custom LINQ Expression with the control
  • Useful Features in SQL Server 2008

    Useful Features in SQL Server 2008

    Encryption at rest

    Whole databases can be encrypted with a master key (which can be stored in an HSM), rather than encrypting by each column. No code changes are required, hence this feature is called Transparent Data Encryption. It gives true encryption of data at rest, included backup files.

    Filtered indexes

    An index can be created with a filter (i.e. index all rows where MyDateField is not null), thus making much more meaningful indexes &rarrow; improved performance.

    Sparse columns support

    There are times when you want to create say 20 columns, only a portion of which will be used at any given time (perhaps there are multiple applications using the table, and they each have a few unique needs). If you create all these columns, your table becomes a little unwieldy in many ways. You can use an XML column to store just the subset required, or in 2008 you can use the new sparse columns feature. This will improve indexing and manageability.

    Performance Data Collector

    The new Performance Data Collector stores query information in a data warehouse, making it easy to answer questions like "whose query was hogging the resources this morning, causing my job to get a timeout?"

    Resource Governor

    Allows the administrator to allocate resource slices to different users or classes of users; thus for instance you could specify that the core processing user would always get (if needed) a minimum of 40% of the CPU & RAM, and you could specify that the marketing users (once they have beefy report models to work with) never get more than 10% of the resources. For example.

    Report Builder

    The Reporting Services Report Builder has been entirely redesigned — now looks like an Office 2007 application. The table and matrix controls have been replaced with a far more flexible tablix control that allows you to do all kinds of cool things.

    Integration Services

    These upgrades are basically in the area of performance improvements, particularly with regard to the Lookup data flow task. Other improvements / new functionality: ADO.Net as default data source (rather than OLEDB); data profiling task; C# as new / default language for scripting tasks.

    Transact SQL / Database Engine

    Finally, we get to the heart of SQL Server: the structured query language. Supposedly this thing is much faster. There is some new syntax available: GROUPING SETS for enhanced BI-type queries; MERGE to perform inserts, updates, and deletes in one statement; the+= operator, and more. There's also the new Change Data Capture for enhanced auditability and better incremental bulk loads.




    Multiple Insert Rows

    SQL Server 2008 supports the option of inserting multiple records in one statement. Each row of data is followed by a comma until reaching the last row where the INSERT command is completed like normal.

    INSERT INTO Customers
    (CustID, CustName)
    VALUES
    ('Cust1', 'Smith Company'),
    ('Cust2', 'Perform Company'),
    ('Cust3', 'Test Inc');

    Other version of SQL Server require a separate statement to be executed for each record insert.

    Friday, April 24, 2009

    Image galleries

    Very Nice Image Galleries

    http://smoothgallery.jondesign.net/showcase/gallery/#

    http://dhtmlsite.com/imagegalleries.php

    http://highslide.com/

    http://www.dhtmlgoodies.com/scripts/image_slideshow/image_slideshow.html

    http://joshuaink2006.johnoxton.co.uk/templates/gallery/index.htm

    http://sonspring.com/journal/slideshow-alternative

    http://iamacamera.org/sandbox/photoshuffler/

    Very Nice Image Slide show
    http://www.cfcms.nl/voorbeelden-van-cfcms-systemen.html

    Nice tool tip & On Image Hover Shows nice image gallery
    http://www.catswhocode.com/blog/how-to-create-a-fancy-image-gallery-with-jquery

    FLASH Image Galleries

    http://www.visual-blast.com/flash/free-flash-gallery-solutions-for-your-images/

    Thursday, October 16, 2008

    Introduction to Object Oriented Programming Concepts (OOP) and More

    http://www.codeproject.com/KB/architecture/OOP_Concepts_and_manymore.aspx

    Free SEO Tools

    Free SEO Tools (Must Have)

    Here are six important SEO Tools to get you started:

    1. Backlink Anchor Text Analysis - This tool is especially useful, as we all know that anchor text (if you don’t, then take my word for it) plays a huge part in the weight given to a link to your site. By inputting your URL, you can check all of the backlinks pointing to your site and the anchor text used for each. Quality, relevant, keyword related anchor text is the best way to link to someone, so if you see people that are linking to you using the infamous “click here”, kindly shoot them an email and ask them to change it if they have time. It’s worth the trouble.

    2. Free Keyword Suggestion Tool - Okay, so I covered this a little in my last post, but it’s definitley worth listing again. As you know, it’s an quick way to nail down some nice keywords, and get a general idea of the amount of search volume each one commands. Quick, easy, and fun.

    3. Domain Stats Tool - Yeah, spying on your competitor is so much fun! This tool comes in handy if you just can’t seem to figure out why your enemies are ranking higher than you (other than the normal stuff). Input a URL, and it will tell you things like domain age, big directory listings, backlink count in the big 3 (Google, Yahoo, MSN). Nothing too detailed, but it may be useful information at one point or another.

    4. Keyword Difficulty Check - This seo tool is just downright cool. In your quest for the ultimate keywords, wouldn’t it be nice to see how difficult it would be to rank for a particular keyword? Problem solved. This famous tool over at SEOChat will do just that. It will tell you how hard it’s going to be percentage wise to rank for whatever keyword you put in. For instance, the keyword “SEO” gets a score of 78.5%, compared to “Florida SEO Company” scores a 42.03%. I could actually do this for hours, so I better move on before I digress….

    5. Google Vs. Yahoo Search Results - Talk about interesting. This tool lets you put in a keyword or keyphrase of your choice, and after it runs, it will present you with a graph showing where they rank on each site. Lines are drawn across the graph for matching domains. It’s very cool to see how each search engine ranks pages for certain keywords. For instance, I ran a query on the keyword “seo tips”, and I noticed that the 3rd result site in Google is ranked well over 40 in Yahoo. Not all of them are that far apart..some are actually really close. By the way, does anyone know the algorithms for each? I just need to borrow it real quick….

    6. Term Extractor - This little handy tool will let you input a URL, and after analyzing, it will tell you what it thinks is a search engine targeted term. This is a VERY clever tool, which I recommend you run on your site periodically, that way if you’re trying to target “garden tools” and the term extractor tells you that it thinks “sea monkey poop” is more SE targeted, that you have some work to do, keyword density wise!

    Tuesday, October 14, 2008

    Ten Must-Have Tools Every Developer Should Download Now

    • NUnit to write unit tests
    • NDoc to create code documentation
    • NAnt to build your solutions
    • CodeSmith to generate code
    • FxCop to police your code
    • Snippet Compiler to compile small bits of code
    • Two different switcher tools, the ASP.NET Version Switcher and the Visual Studio .NET Project Converter
    • Regulator to build regular expressions
    • .NET Reflector to examine assemblies

    Monday, October 6, 2008

    Jokes

    A guy phones up his boss,
    but gets the boss s wife instead.
    "I'm afraid he died last week."
    she explains. The next day the
    man calls again and asks for
    the boss. "I told you" the wife replies,
    "he died last week." The next day
    he calls again and once more
    asks to Speak to his boss.
    By this time the wife is getting
    upset and shouts, "I'VE ALREADY
    TOLD YOU TWICE, MY HUSBAND,
    YOUR TEAMLEAD, DIED LAST WEEK! WHY DO YOU KEEP CALLING?"
    He replied laughing,
    "I just love hearing it...! !"

    keyboard shortcuts

    General keyboard shortcuts

    CTRL+C (Copy)
    CTRL+X (Cut)
    CTRL+V (Paste)
    CTRL+Z (Undo)
    DELETE (Delete)
    SHIFT+DELETE (Delete the selected item permanently without placing the item in the Recycle Bin)
    CTRL while dragging an item (Copy the selected item)
    CTRL+SHIFT while dragging an item (Create a shortcut to the selected item)
    F2 key (Rename the selected item)
    CTRL+RIGHT ARROW (Move the insertion point to the beginning of the next word)
    CTRL+LEFT ARROW (Move the insertion point to the beginning of the previous word)
    CTRL+DOWN ARROW (Move the insertion point to the beginning of the next paragraph)
    CTRL+UP ARROW (Move the insertion point to the beginning of the previous paragraph)
    CTRL+SHIFT with any of the arrow keys (Highlight a block of text)
    SHIFT with any of the arrow keys (Select more than one item in a window or on the desktop, or select text in a document)
    CTRL+A (Select all)
    F3 key (Search for a file or a folder)
    ALT+ENTER (View the properties for the selected item)
    ALT+F4 (Close the active item, or quit the active program)
    ALT+ENTER (Display the properties of the selected object)
    ALT+SPACEBAR (Open the shortcut menu for the active window)
    CTRL+F4 (Close the active document in programs that enable you to have multiple documents open simultaneously)
    ALT+TAB (Switch between the open items)
    ALT+ESC (Cycle through items in the order that they had been opened)
    F6 key (Cycle through the screen elements in a window or on the desktop)
    F4 key (Display the Address bar list in My Computer or Windows Explorer)
    SHIFT+F10 (Display the shortcut menu for the selected item)
    ALT+SPACEBAR (Display the System menu for the active window)
    CTRL+ESC (Display the Start menu)
    ALT+Underlined letter in a menu name (Display the corresponding menu)
    Underlined letter in a command name on an open menu (Perform the corresponding command)
    F10 key (Activate the menu bar in the active program)
    RIGHT ARROW (Open the next menu to the right, or open a submenu)
    LEFT ARROW (Open the next menu to the left, or close a submenu)
    F5 key (Update the active window)
    BACKSPACE (View the folder one level up in My Computer or Windows Explorer)
    ESC (Cancel the current task)
    SHIFT when you insert a CD-ROM into the CD-ROM drive (Prevent the CD-ROM from automatically playing)
    CTRL+SHIFT+ESC (Open Task Manager)

    Dialog box keyboard shortcuts

    If you press SHIFT+F8 in extended selection list boxes, you enable extended selection mode. In this mode, you can use an arrow key to move a cursor without changing the selection. You can press CTRL+SPACEBAR or SHIFT+SPACEBAR to adjust the selection. To cancel extended selection mode, press SHIFT+F8 again. Extended selection mode cancels itself when you move the focus to another control.
    CTRL+TAB (Move forward through the tabs)
    CTRL+SHIFT+TAB (Move backward through the tabs)
    TAB (Move forward through the options)
    SHIFT+TAB (Move backward through the options)
    ALT+Underlined letter (Perform the corresponding command or select the corresponding option)
    ENTER (Perform the command for the active option or button)
    SPACEBAR (Select or clear the check box if the active option is a check box)
    Arrow keys (Select a button if the active option is a group of option buttons)
    F1 key (Display Help)
    F4 key (Display the items in the active list)
    BACKSPACE (Open a folder one level up if a folder is selected in the Save As or Open dialog box)

    Microsoft natural keyboard shortcuts

    Windows Logo (Display or hide the Start menu)
    Windows Logo+BREAK (Display the System Properties dialog box)
    Windows Logo+D (Display the desktop)
    Windows Logo+M (Minimize all of the windows)
    Windows Logo+SHIFT+M (Restore the minimized windows)
    Windows Logo+E (Open My Computer)
    Windows Logo+F (Search for a file or a folder)
    CTRL+Windows Logo+F (Search for computers)
    Windows Logo+F1 (Display Windows Help)
    Windows Logo+ L (Lock the keyboard)
    Windows Logo+R (Open the Run dialog box)
    Windows Logo+U (Open Utility Manager)