Add a blog post

home » blogs » raghav_khunger

Communifire Blogs

CodeAsp.Net"s <strong>ASP.NET Blogs</strong> is more than just a social community for ASP.NET bloggers - we are one of the largest ASP.NET blog directories on the internet. Whether you are looking to search ASP.NET blogs, connect with ASP.NET bloggers, learn more about ASP.NET, or promote your own blog, CodeAsp.Net is for you. Be sure to check back often as we add new ASP.NET blog postings frequently.

Blogs RSS Feed

raghav_khunger : Most Recent postings

Disable enable checkboxes on click of other checkbox

12/27/2009 1:54:02 PM by raghav_khunger   -   0 Comments   -   Views: 282

In this blog i will show how to Disable enable checkboxes on click of other checkbox.Below is the sample code:<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function test() { var chkMain = document.getElementById('chkMain'); var chkFirst = document.getElementById('chkFirst'); var chkSecond = document.getElementById('chkSecond'); if (chkMain.checked) { chkFirst.disabled = 'di...

Read More

How to select records falling between two dates

12/27/2009 1:53:58 PM by raghav_khunger   -   0 Comments   -   Views: 257

In this blog i will explain how to select records falling between two dates. Below is the sample script :DECLARE @MyTable TABLE ( ID INT IDENTITY, [MyColumn] VARCHAR(20) ) INSERT INTO @MyTable SELECT 'Jan 7 2010 7:38PM' UNION ALL SELECT 'Feb 7 2010 7:38PM' UNION ALL SELECT 'Mar 7 2010 7:38PM' UNION ALL SELECT 'Apr 7 2010 7:38PM' UNION ALL SELECT 'May 7 2010 7:38PM' UNION ALL SELECT 'Jun 7 2010 7:38PM' UNION ALL SELECT 'Jul 7 2010 7:38PM' UNION ALL SELECT 'Aug 7 2010 7:38PM' UNIO...

Read More

How to add two numbers with javascript

12/27/2009 1:53:51 PM by raghav_khunger   -   0 Comments   -   Views: 512

In this blog i will show how to add two numbers with javascript. I have used parseInt function to convert the value from string to int.Below is the sample code:<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Untitled Page</title> </head> <body> First Number :<input id="txtFirstNumber" type="text" /><br /> Second Number:<input id="txtSecondNumber" type="text" /> <input id="btnAdd" type="button"...

Read More

How to remove link line from hyperlink

12/27/2009 1:53:43 PM by raghav_khunger   -   0 Comments   -   Views: 251

In this blog i will explain how to remove link line from hyperlink. I have set textdecoration property as none for hyperlink which will remove its link line.Below is the sample code:<html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server">    <title>Untitled Page</title></head><body>    <form id="form1" runat="server">    <asp:LinkButton ID="LinkButton" runat="server" Style="text-decoration: none;" Text="LinkButton"></asp:LinkB...

Read More

How to retrieve identity value of last inserted record

12/27/2009 1:53:39 PM by raghav_khunger   -   0 Comments   -   Views: 401

In this blog i will show how to retrieve identity value of last inserted record. I have used Scope_Identity to get the last identity value.Below is the sample script: DECLARE @Tags TABLE ( TagId INT IDENTITY(1,1), TagName VARCHAR(100) ) INSERT INTO @Tags VALUES ('c') SELECT SCOPE_IDENTITY() AS [Newly Added Identity] --OUTPUT --Newly Added Identity ----------------------------------------- --1 --(1 row(s) affected) Do let me know your feedback, comments.

Read More

Validate atleast one checkbox is checked in checkboxlists

12/27/2009 1:53:35 PM by raghav_khunger   -   0 Comments   -   Views: 144

In this blog i will show how to validate atleast one checkbox is checked in checkboxlists. Say we have multiple checkboxes and we have to validate atleast one checkbox is checked from multiple checkboxes.Below is the sample code:In Javascript:<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <asp:CheckBoxList ID="CheckBoxList1" runat="serve...

Read More

Delete a record from database using ADO.NET

12/27/2009 1:53:30 PM by raghav_khunger   -   0 Comments   -   Views: 105

In this blog i will show how to delete a record from database using ADO.NET. I have used one text box and one button, user will enter id and click submit button, accordingly row will be deleted from database.Here is the codeIn SqlCREATE TABLE [Test_Table] ([ID] INT IDENTITY ,[NAME] VARCHAR(20) ) GO INSERT INTO [Test_Table] SELECT 'NAME1' UNION ALL SELECT 'NAME2' UNION ALL SELECT 'NAME3' GO CREATE PROC DELETE_Test_Table @ID INT AS BEGIN DELETE FROM [Test_Table...

Read More

How to get average of records in SQL

12/26/2009 1:46:35 PM by raghav_khunger   -   0 Comments   -   Views: 132

In this blog i will show how to get average of records in SQL, I have used Avg function of sql in order to do it.The AVG() function returns the average value of a numeric column.Below is the sample script:DECLARE @tblCustomers TABLE ( ID INT IDENTITY, NAME VARCHAR(20), Amount INT ) INSERT INTO @tblCustomers SELECT 'Name1',100 UNION ALL SELECT 'Name2',200 UNION ALL SELECT 'Name3',300 UNION ALL SELECT 'Name4',400 ;WITH CTE AS ( SELECT Amount FROM @tblCustomers WHERE Amount &...

Read More

Check uncheck all checkboxes in Gridview

12/26/2009 1:46:32 PM by raghav_khunger   -   0 Comments   -   Views: 201

In this blog i will show how to check uncheck all checkboxes in Gridview. In many requirements we need a column with checkboxes, and to select all the checkboxes in this column we have one more column in the Header. On selecting this checkbox all the checkboxes in this column are selected and on unchecking the header checkbox all the checkboxes in this column are unchecked.Below is the sample code:In ASPX:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Tes...

Read More

How to select data from multiple tables in SQL

12/26/2009 1:46:25 PM by raghav_khunger   -   0 Comments   -   Views: 146

In this blog i will show how to select data from multiple tables in SQL, though it is simple but it will help many Below is the sample script:DECLARE @A TABLE ( customer_id INT , Product_ID INT ) DECLARE @B TABLE ( customer_id INT ,customer_username VARCHAR(20),customer_password VARCHAR(20) ) DECLARE @C TABLE ( id INT ,product_image VARCHAR(20) ) INSERT INTO @B SELECT 1,'Name1','Pass1' UNION ALL SELECT 2,'Name2','Pass2' UNION ALL SELECT 3,'Name3','Pass3' INSERT INTO...

Read More

Join CodeAsp.Net for FREE Today!

It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.

enter your email address: