Monday, November 14, 2011

How to get nth record in sql

To get nth record in sql use the following sql query:
User with clause
with ordered as(select  *,ROW_NUMBER() over(order by community_ID) as id from dbo.Communities) select * from  ordered where id=nth



How to get first and last record in sql

To get first and last record in sql write the followig query.

select * from dbo.Communities where Community_ID in(select min(Community_ID) from dbo.Communities union select MAX(Community_ID)from dbo.Communities)




Sunday, August 21, 2011

multiple checkbox selection

how to select multiple checkbox in asp.net form page using single check box. go throgh this code in jquery.

<head runat="server">
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
    <title></title>
    <script type="text/javascript" language="javascript">
        var $j = jQuery.noConflict();
        $j(document).ready(function () {
            $j('#chkbox').click(function () {
                var chkid = $j('#chkbox').attr("checked");
                chkid.onc
                var id = $j('.chk input');
                for (var i = 0; i < id.length; i++) {
                    if (chkid) {
                        id[i].checked = true;
                    }
                    else {
                        id[i].checked = false;
                    }
                }
            });
        });  

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ul>
            <li>
                <asp:CheckBox ID="chkbox" runat="server" />
            </li>
            <li>
                <asp:CheckBox ID="CheckBox1" runat="server" CssClass="chk" /></li>
            <li>
                <asp:CheckBox ID="CheckBox2" runat="server" CssClass="chk" />
            </li>
            <li>
                <asp:CheckBox ID="CheckBox3" runat="server" CssClass="chk" />
            </li>
            <li>
                <asp:CheckBox ID="CheckBox4" runat="server" CssClass="chk" /></li>
            <li>
                <asp:CheckBox ID="CheckBox6" runat="server" CssClass="chk" />
            </li>
            <li>
                <asp:CheckBox ID="CheckBox5" runat="server" CssClass="chk" /></li>
        </ul>
    </div>
    </form>
</body>

Monday, July 25, 2011

Using JSON with ASP.NET 3.5

How to use JSON as the preferred data format for invoking Web Services from the client side.
you can learn about this in more detail from the following link:
JSON in asp.net 3.5

Facebook Application development in .net

To develop Facebook Application in .net you can find good resource in these links below:
 computerbeacon
Facebook developer

Sunday, July 24, 2011

Install Membership and Authentication tables and Stored Procedures in SQL server Database

With the help of Visual Stdio Command Prompt you can easily install  Membership and Authentication tables and Stored Procedures in SQL database:
Here is the query:
aspnet_regsql.exe
Type it in visual stdio command prompt and it will show you a asp.net sql server setup wizard: