Loading ...

Who is online?  0 guests and 0 members
home  »  blogs  »  Sumit Arora

Communifire Blogs

Sumit Arora : Most Recent postings

Sumit Arora

SQL:Use Join with Update Command

9/5/2010 by Sumit Arora · 0 · 1246

In this blog I will show how to use Join with Update command in SQL. I had a situation where I had to update the column of a table with the values from other table for all the employees simultaneously. There were 2 tables. a) Emp_Info table which contains a record of all employees like EmpID, EmpName, EmpAddress,EmpAge,TotalSalary. b) EmpSalary table which contains the salary for each mo...

Sumit Arora

Enable/Disable input field using Jquery

8/22/2010 by Sumit Arora · 0 · 9747

In this blog i will explain you how to enable/disable textbox using jquery. <html xmlns="http://www.w3.org/1999/xhtml"> <head > <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> </head> <body> <form id="form1" runat="server"> <div> <input id="txtName...

Sumit Arora

Value of dynamic textbox lost on Postback

8/22/2010 by Sumit Arora · 0 · 5490

In this blog I'll explain you how to retain the values of dynamically created textboxes on Postback. Few days back, I had to create dynamic textboxes on a button click event. There was one more button on that page on which I'd to save the values of the textboxes which I entered in those dynamicaly created textboxes. But on clicking the that button values of dynamic textboxes were becomin...

Sumit Arora

Convert C# code to VB.NET

8/22/2010 by Sumit Arora · 2 · 2618

Every one does search on google for code. At times we end up finding the code we were looking for but in some other languages such as VB.net, C++ etc. Now, that we have found the code but we want that code to be in some other language for ex C#. Someone who works in C# might not know about the syntax of VB.NET. So how to convert the code into the required language? As we all know that .N...

Sumit Arora

Swap values of column in T- SQL

8/10/2010 by Sumit Arora · 2 · 9088

In this blog I will explain you how to change the value of a bit column . Recently, I had a scenario where I had to change the value of a bit type column i.e wherever there were 1 in the column I had to replace it with 0 and vice versa. After doing some searching I found the solution. I did it with the help of Common Table Expression (CTE). Let's create a table and insert few records int...

Sumit Arora

How to bind rule to a column in SQL

8/4/2010 by Sumit Arora · 1 · 2023

In this blog I'm going to explain how we can bind some rule to a Column of a table in SQL. Many times we want that the column must contain the value in a particular format. For Ex. Column Emp_ID should start with alphabet and after that it must contain 3 integers. Like 'A123' or 'E456'. This can be done in SQL by applying rules on the column. 1. Create a table CREATE TABLE EMP ( EMP_ID N...

Sumit Arora

How to validate minimum length in textbox by jquery

11/17/2009 by Sumit Arora · 0 · 8377

In this blog we will see how we can validate the minimum length of textbox. <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Validate Textbox</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> </head> <body > <form id="form1" runat="ser...

Sumit Arora

How to use Client Script at .cs side when update panel is present on the page

11/10/2009 by Sumit Arora · 1 · 3040

Once I was trying to access client script at .cs side by using ClientScript.RegisterStartupScript . But somehow it didn't work.After doing some research I found the solution to it.I realised that the reason why it wasn't working was because of update panel present on the page. ClientScript.RegisterStartupScript(typeof(System.String), "message", "<script> alert('I'm unable to access...

Sumit Arora

How to validate max length in multiline textbox using jquery

4/30/2009 by Sumit Arora · 1 · 8882

I tried to fix the maximum length in multiline textbox by using the property MaxLength. But it didn't work in case of multiline textbox. In this blog i will explain how to get rid of this problem by using jquery. $(function() { $('#ctl00_ContentPlaceHolder1_txtTest').keyup(function() { limitChars('ctl00_ContentPlaceHolder1_txtTest', 100, 'counter'); }) }); function limitChars(textid, lim...

Sumit Arora

How to find users IP address in ASP.NET

3/29/2009 by Sumit Arora · 1 · 9223

Many times there can be a situation where we require the IP address of a user.For ex while placing an order on Shopping portal we need the IP address for security purposes.Below is the code of how to find users IP address in ASP.NET. public string FindIPAddress() { try { HttpRequest currentRequest = HttpContext.Current.Request; string ipAddress = currentRequest.ServerVariables["HTTP_X_FO...

Sumit Arora

How to Update,Edit and delete a row in GridView

3/10/2009 by Sumit Arora · 2 · 10954

Today I would like to share with you how to update,delete and edit rows in GridView data control.Gridview has most of the events inbuilt so one can use these events to perform these operations. 1.To edit a row in Gridview: To edit a row there is an event called RowEditing . protected void gridView_RowEditing(object sender, GridViewEditEventArgs e) { gridView.EditIndex = e.NewEditIndex; /...

Sumit Arora

How to delete multiple records from Repeater Data Control

3/10/2009 by Sumit Arora · 1 · 3625

Many times we face a situation where we want to delete multiple records from the Repeater.To delete multiple records from the repeater on button can be possible but to do so we need to add java script for checking/Unchecking multiple records.You need to add a javascript at page load for selecting multiple checkboxes together inside the repeater data control. Below is the way to do it.We ...

Sumit Arora

How to bind enum with dropdown list

3/10/2009 by Sumit Arora · 0 · 5330

Recently i had faced a situation where i wanted to bind the values and names in the enum to the dropdownlist .After some research i found the way to do it. I'm sharing it with you guys.You can declare the enum like this : public enum Days { monday=1, tuesday, wednesday, thursday, friday, saturday, sunday } Now to bind the values and names to the dropdownlist i used Hashtable.As you all k...

Sumit Arora

Date Format in SQL

3/6/2009 by Sumit Arora · 0 · 2115

I wanted the date format from SQL in this way January, 2008. After doing searching I finally found the way to do it. Here is the solution: SELECT DATENAME(month, DateCreated) AS ByMonth, DATENAME(yyyy, DateCreated) AS ByYear, COUNT(*) AS TotalCount FROM Test where userId=@UserID GROUP BY DATENAME(mm, DateCreated), DATENAME(yyyy, DateCreated) ORDER BY ByYear DESC The output will be in thi...

Sumit Arora

How to validate max length of textbox text

2/4/2009 by Sumit Arora · 0 · 5213

Sometimes there can be a situation where we want to validate maximum length of a textbox content.This can be done in many ways. One way of doing it is through Regular Expression: <asp:TextBox ID ="txtBox" runat="server"/> Now,take the Regular expression validation control <asp:RegularExpressionValidator ID="validateTextBox" runat="server" Display="dynamic" ControlToValidate="txt...

Sumit Arora

Problem with the cancel button in AJAX ModalPopupExtender

1/9/2009 by Sumit Arora · 0 · 3816

I was using modal pop up for both add and edit option on the same page. For this i used ModalPopupExtender of ajaxToolKit .But the problem which i faced was that when ever i clicked on the edit button.The pop up just came out but i didnt make any changes in the fields .So i clicked on the cancel button and the modal pop up just diappeared.The next time when i clicked on the add link the ...

Sumit Arora

How to Validate DropdwonList in asp.net

1/5/2009 by Sumit Arora · 0 · 1725

Validate DropdwonList Hi Today im gonna tell you how to validate a dropdownlist Suppose if you want to validate a dropdownlist where you want that if the user doesnt select any value he/she should get an error message .This is how you can validate it. Her i want that user must select a country from the dropdownlist else he/she would get an error message Select a Country: <asp:DropDown...

Sumit Arora

Server side validation stopped working

12/29/2008 by Sumit Arora · 1 · 1562

Yesterday i was working on a registration page where if a person check the checkbox where the terms and conditions are written only then he/she can register .So i used a client side validation if a person doesn't select the checkbox then the alert box will appear where it is written that you must follow the terms and conditions. But on doing this the server side validations stopped worki...

Page 1 of 1 (18 items)

Product Spotlight

ASP.NET Hosting Spotlight

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:

 

Quick Vote

What kind of email newsletter would you prefer to receive from CodeAsp.Net?