Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Asp.net show the confirmationbox using javascript

Dec 31, 2010 5 comments
Introduction

Here I will explain how to show the confirmation box using JavaScript in asp.net.

Description

I have one button whenever user clicks on that button I need to show one confirmation box if user clicks on ok button I need to execute code in button click event or if he clicks on cancel button nothing to display and the page should not be postback. How we can implement that one in our application? To implement this concept follow these steps

Design your aspx page like this 

how to restrict user to enter only numbers in textbox using javascript and how to restrict user to enter only 10 digits(mobile number) in textbox using javascript or how to restrict user to enter only alphanumeric in textbox using javascript

Dec 30, 2010 39 comments
Introduction

Here I will explain how to restrict user to allow only numbers in textbox and how to restrict user to enter only 10 digits mobile number using JavaScript and I will explain how to allow only numbers and alphabets in textbox using JavaScript.

Description

I have a one textbox now I need to allow user to enter only numbers not more than that if user try to enter characters or alphabets I don’t want to allow those characters in textbox for that I have written one JavaScript function to allow only numbers and allow only 10 numbers.

how to encrypt and decrypt password and stored in database using asp.net or encrypt or decrypt user password with c#

Dec 28, 2010 53 comments
Introduction

Here I will explain how to encrypt data and save it in database and how to decrypt encrypted data in database using asp.net

Description

First we will learn what is encryption and decryption

Encryption is the process of translating plain text data into something that appears to be random and meaningless.

Decryption is the process of translating random and meaningless data to plain text.
Why we need to use this Encryption and decryption processes

 By using this process we can hide original data and display some junk data based on this we can provide some security for our data.

SQL Server 2008 ERROR: Saving changes are not permitted. The Changes you have made require the following tables to be dropped and re-created.

2 comments
Introduction

Here I will explain how to solve problem in SQL Server 2008 Saving changes are not permitted.

Description

 I installed SQL Server 2008 and I created one new database after that I created one table and saved it everything working fine again I opened newly created table to change column name previously I entered wrong name again I changed column name and if I am trying to save that modifications I got error like this

how to bind Datagridview in windows application using c#.net

Dec 27, 2010 37 comments
Introduction

Here I will explain how to bind Datagridview in windows application using c#.net.

Description

I have started working on windows application at that time I don’t know how to use Datagridview and other controls. I face some problems to bind data to Datagridview and to other controls that’s why I am writing this post to explain how to bind data to Datagridview in windows application. In windows application binding Datagridview is somewhat different when compared with web application Datagridview binding.

Asp.net Read/insert data into XML file and bind data to DataList

Dec 26, 2010 32 comments
Introduction

Here I will explain how to insert data into XML and how to retrieve data from XML and how to bind data to DataList using asp.net.

Description:

XML means Extensible markup language why we need to use this one because by using XML we can store the data and we can easily retrieve and display the data without using database in our applications.if we need to display dynamic data in our application it will take time to conenct database and retrive data from database but if use XML to store data we can do operations with xml file directly without using database. If we store data in database that is incompatible to some of the computer applications but if we store data in XML format it will support for all applications. It is independent for all software applications and it is accessible with all applications.

how to use progressbar control in windows application using c#.net

Dec 23, 2010 19 comments
Introduction

Here I will explain how to use progressbar control in windows application using c#.net.

Description

I have done one windows application in that I have one form like creating user and assigning permission to user during at the time of user creation and displaying that result in one data gridview for this process it’s taking time at that time user don’t know what is happening after button click for that reason I have used progressbar to give hint like processing. Previously I have implemented progress bar during postbacks in asp.net check that article here how to show progressbar during postbacks in asp.net .

how to bind arraylist elements to gridview using asp.net

Dec 21, 2010 17 comments
Introduction:

Here I will explain how to bind arraylist elements to gridview using asp.net.

Description:

In my application we bind some of elements to arraylist items after that we need to bind that elements to gridview upto that I don’t have idea to bind arraylist to gridview. I searched many websites and I found good materials regarding how to bind arraylist items to our gridview.

In arrays we have different types

Asp.net show gridview header when there is no data or empty

Dec 20, 2010 19 comments
Introdcution

Here I will explain how to display or show gridview header even if gridview does not contain data or show gridview header with no records.

Description

 In one application I got requirement like show the gridview header even if grddview does not contain any data. In our applications we will send data to dataset and bind that dataset to gridview to display data on form. In gridview we have property called EmptyDataText by using this property we will display message like "No records Found" if gridview contains empty data. It will display the message but it won’t show header of gridview or anything simply it will display only that message (whatever the message we gave to EmptyDataText property). 

It will display message like this without gridview headers

C# - Move Items from One Asp.net Listbox to Another Listbox

18 comments
Introduction

Here I will explain how to move items from one listbox to another listbox in asp.net using C#

Description

In one application I got requirement like work with listbox control in asp.net. First we will learn what listbox control purpose is and how we can use in our application.

The ListBox control is used to display a list of items to the user that the user can select by clicking. A ListBox control can provide single or multiple selections using the SelectionMode property. This tutorial shows you how to move items from one listbox to other listbox and we can move items by using single selection of item or multiple selection of items.

Asp.net make single radio button selection in gridview using JQuery and change selected row style of gridview with radio button using jQuery

4 comments
Introduction

Here I will explain how to make single radio button selection in gridview using JQuery and how to change selected row style of gridview with radio button using jQuery.

Description

In my application I have designed gridview with radio button after completion of all the functionality if try to select radio button I am able to select all the radio buttons in gridview that is like this 

how to make single radio button selection in gridview using javascript

25 comments
Introduction

Here I will explain how to make single radio button selection in gridview using javascript.

Description

In my application I have designed gridview with radio button after completion of all the functionality if try to select radio button I am able to select all the radio buttons in gridview that is like this 

how to set start up page in windows application using c#.net

10 comments
Introduction:

Here I will explain how to set start up page in windows application using c#.net.

Description:

I have worked on web applications in asp.net I didn’t worked on windows application one day we got requirement to work on windows application at that time I don’t’ know anything about windows application even how to set startup page in windows application. I have searched many websites for this after search long time I found answer for this partially.

Asp.net send email with images using Gmail credentials

15 comments
Introduction:

 In this article I will explain how to send email by embedding images using Gmail credentials in asp.net

Description:

Generally we will send mails using SMTP server suppose if we don’t have smtp server in that situation we can send mails by using gmail smtp server in asp.net. I will explain how to implement mail sending concept using Gmail credentials using asp.net. 


To implement this concept first you need to enable POP enable in your Gmail account for this Settings-->Forwarding and POP/IMAP

Regular expressions to validate file extension before file upload in javascript using asp.net

Dec 14, 2010 22 comments
Introduction:

Here I will explain how to check or validate file type in file upload control using JavaScript and regular expression to check file extension before file upload using JavaScript in asp.net.

Description:

I have one page that contains one file upload control to accept files from user and saving it in one folder. Here I need to give permission for user to upload only .doc or .docx files for that I have written validation by using JavaScript to validate files before save it in database.

Here I have some of regular expressions to validate file upload. 

Restrict/Increase the size of file upload in asp.net

9 comments
Introduction:

Here I will explain how to increase or restrict the size of file upload in asp.net

Description:

I have one page that contains one file upload control to accept files from user and saving it in one folder. I have written code to upload file and saving it to folder it’s working fine after completion of my application my friend has tested my application like he uploaded large size file nearly 10 MB file at that time it’s shown the error page like “the page cannot displayed”. 

Again I have search in net I found that file upload control allows maximum file size is 4MB for that reason if we upload file size larger than 4MB we will get error page like “the page cannot displayed” or “Maximum request length exceeded”.

how to show limited characters in gridview columns using asp.net and how to show the tooltip for gridview rows and cells or how to show limit characters in gridview column using asp.net

Dec 10, 2010 17 comments
Introduction:

In this article I will explain how to show limited characters in gridview using asp.net.

Description:

I have created one application for that we have prepared one feedback form to collect feedback from users regarding our application for that we have taken gridview to bind all the feedbacks into one page. Here some of the users have given one line of feedback some of the users have given two lines of feedback remaining people have given feedback with bigger matter at that time if we bind all the feedbacks to one gridview at that time gridview size has increased a lot and in some rows matter is small but columns size is bigger that is just like this

Asp.net Send Email using Gmail or Gmail SMTP Server

71 comments
Introduction:

Here I will explain how to send email using gmail in asp.net or send email using gmail smtp server in asp.net using c#.

Description:

In our system if we don’t have smtp server for sending mails at that time we can send mails by using gmail smtp server in asp.net. I will show to how to implement mail sending concept using Gmail credentials in asp.net. To implement this concept first you need to enable POP enable in your Gmail account for this Settings-->Forwarding and POP/IMAP

To implement this mail concept in your asp.net application first we need to add this reference to our application System.Web.Mail namespace

how to read or write text file using asp.net

Dec 9, 2010 30 comments

Introdcution

Here I will explain how to read or write text file using asp.net

Description

Reading and Writing text file content in asp.net it’s very simple once if we use name space called 

using System.IO;


The System.IO namespace contains types that allow reading and writing to files and data streams and types that provide basic file and directory support.

Check this link for clear information on this namespace Click Here

After that in code we will use Class File to get properties like

how to send mail with attachement in asp.net

Dec 2, 2010 56 comments
Introduction:

In this article I will explain how to send email with attachment using asp.net.

Description:

In previous post I explained how to send mail in asp.net now I will explain how to implement mail sending concept with attachment in asp.net.

To implement this concept first we need to following reference to our application System.Web.Mail namespace 

What is System.Web.Mail

The System.Web.Mail namespace contains classes that enable you to construct and send messages using the CDOSYS (Collaboration Data Objects for Windows 2000) message component. The mail message is delivered either through the SMTP mail service built into Microsoft Windows 2000 or through an arbitrary SMTP server.

Asp.net send email using c#

Nov 30, 2010 91 comments
Introduction:

In this article I will explain how to send email using asp.net.

Description:

In realtime we will use gmail,yahoo,hotmail etc to send mails to particular user here I will show to how to implement mail sending concept in asp.net.

To implement mail concept in asp.net first we need to add following reference to our application System.Web.Mail namespace 

What is System.Web.Mail

System.Web.Mail is a namespace which contains classes that enable us to construct and send messages using the CDOSYS (Collaboration Data Objects for Windows 2000) message component. The mail message is delivered either through the SMTP mail service built into Microsoft Windows 2000 or through an arbitrary SMTP server.

How we can get this reference (System.Web.Mail)

How to disable button after click or during postback and how to change button text after click or during postback in asp.net

Nov 25, 2010 11 comments
Introduction

Here I will explain how to disable button after click or during postback and I will explain how to change the button text after click on button or during postback in asp.net

Description

In many websites we will see disable of button after click on that for getting some content how we can implement that in our application.

Here we need to observe one point that is how we can findout button click and how we can disable button and how we can change text of button during postbacks in asp.net. Here we have chance to get postsbacks by using these statements

SQL Query to get records with or without null values from database

Nov 24, 2010 6 comments
Introduction

Here I will explain how to write a query to retrieve records with or without null values from database in SQL Server.

Description

I have one table with three fields like this 

UserId
Name
City
Education
1
Suresh
Guntur
B.Tech
2
Nagaraju
NULL
MCA
3
Sai

MBA
4
Madhav
NULL
MBBS

Now I need to retrieve records from this table where City not null in this situation I have written query like this.

Query to get only date from datetime in sql server like dd/mm/yyyy, mm/dd/yyyy, yyyymmdd, dd-mm-yyyy etc

Nov 23, 2010 11 comments
Introduction

Here I will explain how to convert or get only date from datetime in different formats like like dd/mm/yyyy, mm/dd/yyyy, yyyymmdd, dd-mm-yyyy etc in SQL Server.

Description

In many situations I got requirement like changing datetime to date and changing the date format to different ways like dd/mm/yyyy or mm/dd/yyyy or dd.mm.yy or yy.mm.dd. We can covert our datetime to date with different formats using different styles. I will display different format of dates with samples check it 

JavaScript make some text non editable - know position of cursor in textbox and disable delete and BackSpace options in keyboard

Nov 4, 2010 4 comments
Introduction

Here I will explain how to make some text non editable in textbox and how to know position of cursor in textbox and how to disable delete and BackSpace buttons in keyboard using JavaScript.

Description

Here I have one country dropdown and one textbox based on the selection of country from dropdown I need to display country codes in textbox. After that user enter mobile number here my requirement is user can edit his mobile number but I don’t want to give chance to edit country code in textbox for that requirement I have written below code

Write following code in your aspx page and check 

how to show the progressbar during postbacks in asp.net

Oct 31, 2010 39 comments
Introduction

Here I will explain how to show update progressbar during postbacks in asp.net

Description

In many websites we will see loading images during process of their websites how we can implement that for our website.

In Ajax we have a control called UpdateProgress control by using this control we can implement progressbar during postsbacks in asp.net.

Here we need to observe one point that is how we can findout postbacks and raise that progrssbar during postback operation in asp.net. Here we have chance to get postsbacks by using these statements

Populate One Asp.net Dropdown based on Selection in Another Dropdown

61 comments
Introduction

Here I will explain how to populate one dropdown based on selection in another dropdown asp.net using c#.

Description

I have three dropdowns Country dropwdown, State dropdown, Region dropdown I need to populate states dropdown based on country dropdown and I need to populate region dropdown based on states dropdown for that what we have to do first design three tables in sql server with data like this 

Calculate age of person from date of birth using JavaScript

Oct 26, 2010 18 comments
Introduction

Here I will explain how to calculate age of person from date of birth and regular expression for mm/dd/yyyy format using JavaScript.

Description

In some situation we need to display age of person based on date of birth .In that situation we can calculate age of person using JavaScript by comparing present date and date of birth as shown below. Here I have a one textbox every time I need to validate that data whether user enter valid data or not if the date not in mm/dd/yyyy format or not.
Regular expression for mm/dd/yyyy date format is

re=/^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d+$/;

If you want to implement code for calculate age of person using javascript design your aspx page like this

Registration form example to insert user details in database using asp.net

Oct 24, 2010 74 comments
Introduction

Here I will explain how to insert registered user details in database and how to get output parameters returned by SQL Query in asp.net.

Description

I have one registration form that give a chance to register new user .In registration form user needs to enter fields UserName, Password, Confirm Password like this I have nearly ten fields are there now I need to check whether this username already exists or not if username not exists I need to register user otherwise I need to display message like username already exists I am doing this thing using query. Here is the link it will explain how to write sql query to return output parameters 

how to display Good Morning,Good Afternoon and Good Evening Messages based on time in asp.net

Oct 22, 2010 7 comments
Introduction

I will explain how to display Good Morning,Good Afternoon and Good Evening Messages based on time in asp.net

Description

In some of websites we will see greeting messages like good morning, good afternoon and good evening messages how to display those messages in our website. Basically those messages will display by calculating present time and we can display that greeting messages.

For that first design your aspx page like this  

Javascript validations for Email,Phone no and allow only characters, spaces, numbers in asp.net

17 comments
Introduction 

Here I will explain how to validate Email,phone number,to allow only characters and spaces and for allow only numbers using JavaScript validations in asp.net.

Description

I have a one sample registration form that contains fields like Name, Email, PhoneNo .
Now I want to check whether user enter correct email format or not, and phone number contains only numbers or not and name contains only characters and spaces or not by using JavaScript.

Here some of commonly used regular expressions

Javascript validations to validate form in asp.net

10 comments
Introduction 

Here I will explain how to validate form using JavaScript validations in asp.net 

Description

I have a one sample registration form that contains fields like Username, Password, Confirm Password, First Name, Last Name, Email, PhoneNo and Location.
Now I want to check whether user enter data in all fields or not and I want to check whether user enter correct data in all fields or not by using JavaScript.

If I want to check whether user enters data in textbox or not write script like this 

Stored procedure with output parameter in sql server

Oct 19, 2010 37 comments
Introduction:

Here I will explain how to write query to return output parameters in SQL Server.

Description:

In some situations we need to return the output value after execution of our query here I will explain with simple user registration here I am returning one out parameter if the query executes successfully else I am returning another output parameter .

SQL Server - Move Data from One Database Server to Another Database Server

Oct 14, 2010 3 comments
Introduction

Here I will explain how to transfer or copy or move data from one server database table to another server database table in SQL Server.

Background

I created one table Addresstype in database1 in server1 with some data. I have created same table Addresstype with same columns in database2 in server2. Now I want to fill AddressTpe table in server2 with data of Addresstype in server1.

Cannot open database requested by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Oct 6, 2010 15 comments
Introduction

Here I will explain about my database connection error in SQL Server if trying to get data by using asp.net.

Description

I have created one database in my Local SQL Server Management Studio in that I created one table and entered some data in that table.

Asp.net set session timeout in web.config IIS

Oct 2, 2010 12 comments
Introduction:

Here I will explain how to set session timeout in web.config,IIS and in application using asp.net manually.

Description:

By default our websites session timeout is 20 mins after that session will gets expire suppose if we want to set our custom timeout in our applications we can set it in different ways (web.config, global.asax and in IIS)

Convert objectdatasource to dataset or datatable in asp.net | How to bind dataset with an Objectdatasource data in asp.net

Sep 29, 2010 3 comments
Introduction:

Here I will explain how to bind dataset with objectdatasource data using asp.net

Description:

Here we need to remember that if we bind our gridview with objectdatasource that objectdatasource fill with data only whenever gridview databind is called like this 

gridview1.DataBind()=ods (ods is ObjectDataSource);

How to show only current dates of current month in ajax calendar extender using asp.net

Sep 28, 2010 2 comments
Introduction

Here I will explain how to show only current dates of current month or whichever month in ajax calendar extender using asp.net.

Description

We can display only current month days to user in calendar control just by using css styles First add Ajax tollkit reference to your project and register that ajax referece like this in your aspx page

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

After that design your aspx like this

How to Create Controls Dynamically in code behind files using asp.net

Sep 26, 2010 18 comments
Introduction:

Here I will explain how to generate the controls dynamically in code behind using asp.net

Description:

Hi here I will explain how to generate the controls dynamically in asp.net code behind
First design the your aspx page with one panel like this 

how to get read only textbox control values in codebehind using asp.net

Sep 24, 2010 16 comments
Introduction

Here I will explain how to get read only control values in codebehind using asp.net 

Description

If we set ReadOnly="true" property  for textbox it won’t give any chance to enter value or change the existed value .If we try to get data in textbox server doesn’t process the read only text box because the value of the text property is preserved in the view state between postbacks unless modified by server-side code. In some situations we don’t want give chance to user to enter data except from calendar control in that situation we need to set that textbox read only in serverside like this 

Gridview checkbox validation using javascript

Sep 21, 2010 15 comments
Introduction

Hi here I will explain how to check the checked status of checkboxes in gridview using JavaScript 

Description

I have a one gridview with checkboxes and one button if user clicks on button I need to raise validation if user doesn’t checked at least one checkbox in gridview for that I have written one JavaScript function to check whether checkboxes selected in gridview or not.

For that write the following code in aspx page

Validation for Email and URL using in javascript

Sep 20, 2010 1 comments
Introduction:

Here I will explain how to validate the textbox and whether that textbox contain valid email or url address using asp.net

Description:

Here I will explain how to validate the textbox and whether that textbox contain valid email or url address using asp.net.

First write the following code in aspx page 

how to Import data from EXCEL to SQL Database in ASP.NET

Sep 15, 2010 196 comments
Introduction

Here I will explain how to Import or insert data into SQL database from Excel spreadsheet using Sqlbulkcopy method.

Description

 I have searched for so many posts that explain static manner some of the posts are not clearly some of the posts are not supporting for latest excel files so many problems i faced by using those examples I have done application that will support for all excel versions and it will work for you without having any problems and it will dynamically you can upload excel sheet from anywhere from your computer.

First of all create Excel workbook as shown in image below and insert some data into it. Please design excel sheet like whatever I shown in image

finding sundays in given month using SQL Server

Sep 12, 2010 3 comments
Introduction:

Here I will explain how to finding Sundays in given month using SQL Server.

Description:

Till now I kept some articles which are related to asp.net and c# the following query is used to find the Sundays in the given month, I hope it’s very useful any query regarding it you can post as comments

Disable button if gridview doesn't contains any Data in asp.net

Sep 7, 2010 3 comments

Here I will explain how to disable button if gridview doesn’t contain records.
Now I have a two button Button1 and Button2 and one gridview. Now I want to display Button2 and gridview whenever user click on Button1.if user clicks on Button1 before displaying the Button2 and gridview I need to check if gridview has data or not if that gridview doesn’t contain data disable Button2 and display gridview with No Records found .For that I have written one function in button click like this

What is the difference between Unit testing,Assembly testing,Integration Testing and Regression testing

Sep 4, 2010 7 comments
Introduction:

Here I will explain difference between Unit testing, Assembly testing, Integration testing and Regression testing 

Description:

Unit testing is also called as Component testing. Unit testing ensures that reliable program unit meets their requirements. Unit testing is normally conducted by programmer under the supervision of the project lead or the team Lead. Main objective of this testing is to test each unit in isolation and individually. This is done by knowing what the inputs to the unit are and what the expected outputs for the same. Unit testing is a white box activity. Unit test normally comes in the implementation phase of the project. 

If we have two version of same assembly in GAC how do we make a choice in asp.net?

0 comments
Introduction:

Here I will explain if we have two version of same assembly in GAC how we make a choice.

Description:

In interviews it’s common Question for everyone. Let’s say you have made an application and its using a DLL which is present in GAC. Now for some reason you make second version of the same DLL and put it in GAC. Now which DLL does the application refer? Ok by default it always uses the version by which you have compiled you application in IDE. But you want that it should actually use the older version. 
© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.