.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

representing 5 digit no to 2 digit no for displaying and back to orginal no when required

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :.NET Framework

hi experts,

     I want to reduced space of a file.

eg if input is less than 5 digit 999999 then due to some logic on this convert it to 2 digit no eg AB and when required back to the original no(99999). so this will consume less space. plz can any body provide any hint logic.

View Complete Post

More Related Resource Links

Retrieve month name and last 2 digit of yr from date column

Table contain one column [d_matur] [datetime] NULL 2014-06-20 00:00:00.000 2015-03-20 00:00:00.000 like this now I want to retrieve month name like June as well as last two digit of year like 14 if anyone know query how to get these from above column please let me know.Thanks

select last digit in sqlserver and check it ?

hi all i have this case RIGHT   (LTRIM(RTRIM(ListPrice2)), 1) = '0' this will get the last digit from ListPrice2 column i want to check if it equal ZERO then Remove it ? how can i do that in sql server ? please help !!!!

ASP.NET PageMethods - Back Button Causing 'Authentication Required' Prompt


Since last week I've had a really odd issue with PageMethods and the back button which i've never seen before.

Essentially, I have a 'home page' which on document.ready (using jQuery), loads some data through PageMethods, and then renders a list - from which you can click through to a details page about  the item. In general use, it works fine. However, using the back button after clicking through (ie: going back to the home page), it throws a PageMethods error. The browser's 'authentication required' prompt appears, and if you click cancel, the server returns a 404. The error returned by PageMethods on the client side is 'authentication failed'.

Just FYI, the application is using ASP.NET forms authentication. The weird thing is, this happens as soon as you click the link and click back. It's not like the authentication cookie has expired or anything, and if you click cancel when the prompt appears and refresh the page, it works fine. I just can't work out what is going on.

I've tried disabling caching on the page [as I thought it was something to down with some browsers' caches of the DOM), but the same thing happens.

One workaround i've had is to redirect the page to itself if the PageMethods error is 'authentication failed', which does work - but only when you cancel the authentic

decimal after 2 or 3 digit


Table 1


loan amt dec 10 Eur 12400

loan amt dec 10 t bond 12345

loan amt nov 20 t call 9975

loan amt 20t call 95250

I have to retrieve amount from above col like 12400 ,12345 and 9975 .I know the code for this like

select substring(col1,len(' ')-charindex(' ',reverse(col1))+Len(col1)+1,Len(col1)) from table1

There is space after every word in col1.

I am getting





Requirement is change I want decimal now if first digit is 1 than I have to put decimal after 3 digit ,if first digit is other than 1 than I have to put decimal after 2 digit

 I want output like this like this





If you know about this please let me know.Thanks in advance




Hi Experts.... I'm trying to get Fiscal Weeks in the form of year + week number in 6 digit format b

CONVERT(int,(cast(datepart(year, AuditDate) as varchar) + (case when (datepart(WK , AuditDate) < 9) then '0' else '' end) + cast(datepart(WK , AuditDate) as varchar))) As 'FiscalWeekId' 

20069 > 200609
20069 > 20060

looking for 7 digit phone numbers


How would I write a select statement to locate phone numbers that only contained 7 continuous digits?  I'm trying to locate numbers that were entered into the database without the area code.  Is there code that I could use to return only phone numbers that have 7 digits and no more?

Lee Markum

Regular Expression needed for 10, 11, or 12-digit number in code behind


Hi there,

I am in need of validating a number that can be 10, 11, or 12 digits in lenght.  It cannont contain any spaces, symbols, or letters.  I have to do this in the code behind of my web form.  I am using C# ASP .NET 2.0. 

exact 16 digit number


hi tutor's



Dim i As Integer

For i = 1 To 20If Mid(sstring, i, 1) Like "[0-9]" Then

identinumber = identinumber + Mid(sstring, i, 1)

End If


What is Regular Expression for 8 digit?

Hi all
I have a problem about using Regulart Expression in my code.
I try to use "\d{8}" expression for checking fixed 8-digits.
Regex aRex = new Regex("\\d{8}");
But the result is not Ok. Because of I can input more than 8-digit number.
Such as I can input "1111111111" (10-digits).
What is Regular Expression for 8 digit?

Displaying SharePoint lists in Web Parts

When you create a built-in or custom list in Microsoft Windows SharePoint Services, Windows SharePoint Services creates a Web Part, a basic building block of a SharePoint site, to display that list. These Web Parts are called List View Web Parts. Windows SharePoint Services stores List View Web Parts in the site collection Web Part gallery. (The site collection Web Part gallery is the most central gallery of Web Parts for a work group. By default, the gallery name is the name of the site, such as "Our Team Site Web Part Gallery." )

Displaying Row Details Tooltip on GridView using JQuery

Continuing exploring JQuery! I decided to implement a feature to display some kind of details related to a row displayed on GridView. For example when displaying employees details on GridView some information might not fit in the GridView because it will make it huge and wide. These infomration can be diplayed as Tooltip. Or when you want to display a picture and some kind of formated text to be diplayed as tooltip when mouse hover on the image.

Using ASP.NET 3.5's ListView and DataPager Controls: Displaying Data with the ListView

Prior to ASP.NET 3.5, developers who needed to display a set of records could choose between the GridView, DataList, and Repeater controls. The GridView provides rich data features, but has a very boxy layout; the DataList and Repeater allow for a more flexible layout, but lack the "point and click" data features found in the GridView, DetailsView, and FormView controls. The ListView bridges the gap between layout flexibility and built-in data features.

This article, the first in a series of articles on the ListView and DataPager controls, looks at the ListView's many available templates and illustrates how to display data. Read on to learn more!

Displaying Data using ASP.NET 2.0 Repeater and C#

This tutorial will show you how to display data using the .NET Repeater Control, ASP.NET 2.0 and C#.NET

The Repeater control is a powerful tool and is easy to use.

First, you will need to import the System.Data.SqlClient namespace.

Post back puzzle


Hi, I have a website where the user makes a selection from a combo box and it then fills a couple text boxes with text based upon the selection. I'm sure as you know it could take a second for the text to appear in the text box due to the post back. I know there is no way to make it instantanious, so what I would like to do it fill the text box with somthing like "Loading Info..." so the user does not type in it while the information is loading.

If you would like to see what I mean please go to this page: www.epiclinks.com/create.aspx and mess around with the combo boxes and You'll see what I mean.

What I would like to do is have it do a post back to write "Loading Info..." and then do another post back to fill it in based upon their selection. How would I do this?

I'm up for anything, so if you have a better solution than that please let me know.


Displaying Dicom images..........



Please guide

  1. How to display Dicom images in .net web apllications.
  2. How can i convert Dicom images to Jpeg.
  3. Can uplease provide me with a sample web application??

form feild hints are not displaying for textboxses inside create user wizard?



I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend