Sid’s Blog

(life => life.make_it_better)

What if I don’t have SQL Express installed?

| Comments

 what if I don’t have SQL Express installed?

If you don’t have SQL Express installed and running, you may have got the following error when your code tried to read or write some data:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Blah blah blah… No problem! You can quickly switch to use the new SQL Server Compact – a lightweight, in-process database – without having to download or install anything manually. Simply add SQL Server Compact to your project by issuing the following command in the Package Manager Console:

Install-Package EFCodeFirst.SqlServerCompact

Extract key/values from FormCollection in ASP.NET MVC action method

| Comments

To avoid you from having to chase for the same information: here’s how you extract key / value pairs from the FormCollection that comes as an argument in an ASP.NET MVC action method:

public ActionResult Create(FormCollection formCollection){ foreach (var key in formCollection.AllKeys) { var value = formCollection[key]; // etc. } foreach (var key in formCollection.Keys) { var value = formCollection[key.ToString()]; // etc. }}

Must Have Developer Tools! Some tricks to develop quicker

| Comments

Google Developer Tools, Some tricks to develop quicker

  1. View Source => By going through menu navigation or Ctrl-Shit-I on windows or Cmd-option(alt)-I on mac.
  2. Or for particular element, just right click on it and choose inspect element.
  3. For fast navigation, prefer keyboard arrow keys to collapse or expand DOM elements. You will find the width and height of that active element as you move in Developer Tool.
  4. To get the full view of the page, try Ctrl - (minus) to zoom out so as to see your whole page with developer tools open without scrolling. Sometimes useful to me.

The Building Blocks of JavaScript Programs

| Comments

This post is second is series of learning JavaSciprt fundamentals. You may like to visit this article to go through all the posts in the series.

Now, we will learn some building blocks the bits and pieces, that one should know to write JavaScript code.

The working demo for this post is here.

Outline

  • Comments - using which you can write some hints for a piece of code.
  • Variables
  • Null - a special object in JavaScript programs
  • Undefined - which is slightly different primitive type in JavaScript.
  • Finding Help - we will see where we can go for any assistance/docs for JavaScript.
  • Objects
  • Equality - how things are compared in JavaScript which one should be aware of it.

Learn Modernizr Library with some quick Demo

| Comments

If you are reading this article you might already know what Modernizr has to offer but the post aims to give you some working demo instead of a content based approach. If you are looking for a documentation it is available on their website and it offers a step-by-step guide. But while using it, I have found that there was a lack of demo that how to really use its features in real world, so, I thought of creating a demo which you can fork it and keep it for your own reference.

Our users always remember the website experience that we offer

| Comments

I would like you to see some of the examples that I have in order to understand the advantages of a responsive web design.

For a quick demo, I request you to click the links below. Those websites are very good and is already helping a business. The links below will demonstrate you a user’s experience when they are browsing our websites from different devices:

Some tools to instantly code faster…

| Comments

I thought it would be great if I share the knowledge that I have with you. This  is my attempt to share my knowledge that can help you code in a better way and it would be great if you also share the tools you have in your arsenal.  1. Let us take a demo. If I ask you create this piece of html,

<div id="page"> <div class="logo"></div> <ul id="navigation"> <li><a href="">Item 1</a></li> <li><a href="">Item 2</a></li> <li><a href="">Item 3</a></li> <li><a href="">Item 4</a></li> <li><a href="">Item 5</a></li> </ul></div>

Learning JavaScript Fundamentals

| Comments

I was about to start a project which is heavily based on JavaScript. I thought it will be a good approach if I also start learning JavaScript fundamentals for my bad memory! And thought, if I am learning something from scratch, I should write it somewhere for me and for others. Though from scratch, but this series fo learning JavaScript fundamentals will be jump start tutorial. I will try to cover all the basic stuff. Let us start now.

An Introduction to JavaScript

| Comments

We will focus on JavaScript as a programming language rather than its usage in web or ajax based applications. Because, one should know the building blocks of a language to really make most out of it.

Overview

  • What is JavaScript?
  • Why is JavaScript important?
  • History
  • An Hello World demo
  • JS Bin / CodePen / JSFiddle / JSDB- a handy tool for you.