Friday 13 November 2015

Learn English From This Links

grammer.ccc.comment.edu
www.ucl.ac.uk/internet-grammar
hypergrammar/arts
pardueowl-
britishcouncilgrammar(learnenglish)
BBcLearningEnglish
StockexchangeEnglish
English-Test.net

Monday 26 October 2015

Server Error in '/' Application.


A storage mechanism has already been configured for this application

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: SharpArch.Core.PreconditionException: A storage mechanism has already been configured for this application




Solution

I got Same Issue   solved by resetting the iis using following command

                                    Try to run iisreset command

in command prompt

Wednesday 21 October 2015

Crud Operations or(Scaffold ) On MVC using Nhibernate

Crud Operations or(Scaffold ) On MVC  using Nhibernate

CREATE TABLE [dbo].[Employee](
      [Id] [int] IDENTITY(1,1) NOT NULL,
      [Name] [nvarchar](255) NULL,
      [PhoneNumber] [nvarchar](255) NULL,
      [Designation] [nvarchar](255) NULL,
      [Email] [nvarchar](255) NULL,
      [DeptNo] [int] NULL,
PRIMARY KEY CLUSTERED
(
      [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Department]    Script Date: 10/21/2015 17:29:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Department](
      [DeptNo] [int] IDENTITY(1,1) NOT NULL,
      [DeptName] [nvarchar](255) NULL,
      [Location] [nvarchar](255) NULL,
PRIMARY KEY CLUSTERED
(
      [DeptNo] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

Sunday 31 May 2015

Signal R



Signal r is a new developer’s API provided for ASP.NET web applications, used to add "real time" web functionality to ASP.NET applications. "Real Time" web functionality is the ability to have server code to push contents to connected clients.
SignalR supports "server push" or "broadcasting" functionality. It handles connection management automatically. In classic HTTP connections for client-server communication connection is re-established for each request, but SignalR provides persistent connection between the client and the server.SignalR is an open-source API, and is accessible through GitHub.
Where to use:

·         Chat room applications
·         Real-time monitoring applications
·         Job progress updates
·         Gaming applications

What technologies does SignalR use to transfer data?

·         Using WebSockets if it is available
·         Otherwise, using other technologies, e.g. long polling,Server Sent Events ,Forever Frames

What kind of data does SignalR support to transfer?

  • Non-compressed JSON text or plain textIf you want to transfer compressed JSON or BSON or your binary data, you have to encodeusing Base64) or to
  • Implement IJsonSerializer by your own logic on the server side and implement the same logic on the client side. Note that TextReader and TextWriter are used inside SignalR. That means you have to convert your data to text before transferring anyway.

API Details:

SignalR provides two models for communication:
1.    Persistent Connections
The Persistent Connection API gives developer direct access to the low level communication protocol that SignalR exposes. This API uses the format of the actual message sent that needs to be specified and if the developer prefers to work with messaging and dispatching model rather than a remote invocation.
2.    Hubs:
It's a High Level API written over PersistentConnection. This API allows the client and server to call methods on each other directly. Hubs also allow you to pass strongly typed parameters to methods, enabling model binding.


Figure: chat application process

Web Sockets:

They allow a long-held single TCP socket connection to be established between the client and server which allows for bi-directional, full duplex, messages to be instantly distributed with little overhead resulting in a very low latency(no delay) connection.
Both the WebSocket API and the WebSocket protocol are standardised which means the web now has an agreed standard for realtime communication between Internet clients and servers.

References:



http://www.codeproject.com/Articles/524066/SignalR-Simple-Chat-Application-in-Csharp




http://ruwandotnet.wordpress.com/2012/03/17/74/

Thursday 28 May 2015

COMPUTER TRICKS

DOWN LOAD  SONGS


Find direct download links for songs using Google 
Just paste the search query given below in google, replace the 'songname' with the name of the song you want to download and you'll get direct download links for that song.

?intitle:index.of?mp3 songname

Example:
Step 1:
Suppose you want to download 'Tum hi ho' song from Aashiqui-2,you just have to type in google:
EX:
?intitle:index.of?mp3 tum hi ho   

                                                            SHUTDOWN YOUR SYSTEM FROM DESKTOP ICON
I learn from Quora.com some very interesting and helpful answers in this topic, now here is a simple trick that used by me to shutdown the computer directly from the desktop.

In Windows 8, Microsoft decided to remove the start button and this made it very difficult for many users to shut down the computer. Here I'm giving a simple trick to do it very easily :

1. First right click the mouse button, select New and then Shortcut as seen in the pic below

2. A dialog box appears as shown in the pic below and copy paste this command shutdown /s /t 0 (last is zero) as shown below

3. Click Next and then give a name (by default it'll be "shutdown.exe") and give a name of your choice if needed and then click FINISH.
4. Hurray !!!

Now you have created a shutdown shortcut and double click the Icon and the computer will shutdown. Simple isn't it !!!

5. Now the Icon seems weird and we can change it by right clicking theshutdown icon we just created and select Properties as shown below

6. dialog box may appear saying Select icons from the available and click OK.


In Properties select Change Icon as shown in fig (red rounded)

7. Another small dialog box appears and select any of the icon and click OK. I have selected the red rounded icon which is appropriate for Shutdown.
8. Now your Shutdown shortcut is ready and it looks good now !!
This is how the Icon appears.
 
Further more if you need to pin this shortcut to the Start Menu then right click the Shutdown Icon and select Pin to Start.

Finally you have shutdown shortcut both in the desktop and the start menu. 
In start just CLICK on the shutdown tile and the computer will shutdown.

There are many softwares to restore Start Menu to Windows 8, but many of them will make your computer slow and thus this will be easy option for people who install those softwares to just shutdown the computer.

Hope this helps you all.

                 



Wednesday 27 May 2015

DropdownList with Images using C# and Asp.Net


Step 1 - Create new Project -> Select ASP .NET Web Application -Give a Name (as your wish ) as DropDownWithImages

Step 2- Create New WebForm  name it as DropExample.aspx.

Step 3- Create  a table  With Following Columns


Step 4 - Insert Records  in the Table 



Step 5 - Add a new Folder name it as images and add  images to the folder what  You inserted in Table  and create another Folder  name it as Scripts and add js files  download js files from this link.


Step 6- in Source page (i.e DropExample.aspx) write following Code

DropExample.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DropExample.aspx.cs" Inherits="DropDownWithImages.DropExample" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Dropdownlist with Images</title>
    <link href="Scripts/dd.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="Scripts/jquery-1.6.1.min.js"></script>
    <script src="Scripts/jquery.dd.js"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function (e) {
            try {
                $("#ddlImagedropdown").msDropDown();
            } catch (e) {
                alert(e.message);
            }
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <table>
            <tr>
                <td align="right">
                    <b>Profile:</b>
                </td>
                <td>
                    <asp:DropDownList ID="ddlImagedropdown" runat="server" Width="150px" OnSelectedIndexChanged="ddlImagedropdown_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>

Step 7- Add Connection String in Web.config file.
 In Web.Config:

<configuration>
    <appSettings>
    <add key="DbConn" value="Data Source=kiran-pc;Initial Catalog=RNDDatabase;User ID=sa;Password=123"/>
  </appSettings>
</configuration>

Step 8 - Write below code in code behind (i.e DropExample.aspx.cs) 

DropExample.aspx.cs:

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

namespace DropDownWithImages
{
    public partial class DropExample : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bindddl();
                BindTitle();

            }
        }


        protected void Bindddl()
        {
            string str= ConfigurationManager.AppSettings["DbConn"].ToString();
            SqlConnection con = new SqlConnection(str);
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from DropDownImages", con);
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            adp.Fill(ds);
            ddlImagedropdown.DataTextField = "Name";
            ddlImagedropdown.DataValueField = "Image";
            ddlImagedropdown.DataSource = ds;
            ddlImagedropdown.DataBind();
            con.Close();
        }
        protected void BindTitle()
        {
            if (ddlImagedropdown != null)
            {
                foreach (ListItem li in ddlImagedropdown.Items)
                {
                    li.Attributes["title"] = "images/" + li.Value; 

                }
            }
        }

        protected void ddlImagedropdown_SelectedIndexChanged(object sender, EventArgs e)
        {
            BindTitle();
        }
    }
}
Step 9 - build Run the apllication we get output  like this.






Search Keyword