.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

Formatting the number

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
Hi All,i have  the number as 1000 but t want to display as 1,000.i can do this by using String.Format("{0:#,###}", 1000)but my requirement is 1000  to  1,00010000   to   10,000100000  to  1,00,0001000000  to  10,00,000 and so on..String.Format("{0:#,###}", 1000000)  is giving output as  1,000,000  i need 10,00,000How to do thisPlease help me in thisThanks in advance,Nikhil  

View Complete Post

More Related Resource Links

Conditional Formatting - Verify a number of check boxes have been checked before showing a button?


I would like to Hide a Submit button until all the check boxes are equal to true? How would I go about verifying all boxes equal true?

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


Embeb a variable number of videos


I need to provide some alternate content for my non-Flash users.

I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.

How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code.  But this seems inelegant.

Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?

Article commenting by line number


I'm wondering what's the best way to approach an online article system that allows users to comment by clicking on the line they are commenting about? Essentially the same way Adobe Acrobat works with comments where you can click anywhere and the text is saved for that location.

I'm assuming a mix of jQuery would be the crux of the interface. The system would need to save comments so that when another user logs in, they will also see the other comments but they can´t edit them - only add their own.

Any suggestions would be great.

The number of members in the conceptual type ... does not match with the number of members on the ob



I've added a scalar property to an entity and now ASP.NET Dynamic Data scaffolding throws this error:

The number of members in the conceptual type 'TrainingModel.Users' does not match with the number of members on the object side type 'TrainingModel.Users'. Make sure the number of members are the same.

This happens at the following line in global.asax:
model.RegisterContext(typeof(TrainingModel.TrainingEntities), new ContextConfiguration() { ScaffoldAllTables = true });

Please help!

huge number of data from database ... so how to minimize load time


Hi ...

I have used the above method to configure my crystal report ...

Its working fine , But i have huge number of data in database ....

So , it take long time to load the report ...

So , i have decided to show only the last 50 records inserted into the database , not all the 500 records to be loaded every time.

Plz help me with this issue  ...


Also , Plz explain me abt index legend in crystal report.

date formatting


I have a 3 field table in sql server express and one of the columns is a date.

I'm trying to pull that in and publish to a gridview, but when I do it comes in with the date and minutes and seconds, etc.

How can I format that so that I only publish MM/DD/YYYY?

thanks in advance 

On page loading or executing all CSS flags are ignored and website is plain without formatting


 My problem is whenever i execute my app the first page that loads is the login page pointed to by my web.config file forms authentication, this page is meant to show CSS formatting for the info i am displaying but it is not. Any help with this problem would be great. A cut and paste of my problem is shown below as you can see there is no CSS.

jsfdnjldfngjfg here it is

Account Login
User Id:
Forgot Password?

I have inserted all the link as in:




CLR Inside Out: Formatting and Parsing Time Intervals in the .NET Framework 4


Learn about enhanced TimeSpan formatting and parsing features coming in the .NET Framework 4, and some helpful tips for working with TimeSpan values.

Ron Petrusha

MSDN Magazine February 2010

How to show 0 as first number in column


Hi guys. I have two little problem.

I have database with one table and it has 4 rows.

1. I want to show a zero in front of all number. Actually i added but it doesn't show.

2. If i don't put any value in column is it possible to have minus for example instead of 0?




I post it like that because i can't see how to post pics directly.

P.S. The columns with numbers have checked "allow nulls".

I draw in paint so it's not so good but i think it's understandable.

10x in advance.

'Meter number is not registered ' error FedEx ship web service move to production



I want to integrate FedEx ship web service in my website. It works fine for local but for production it gives error. I changed test credentials by production credentials. also changed test url "https://gatewaybeta.fedex.com:443/webservices" by production url "https://gateway.fedex.com:443/webservices" But I am getting error that meter number is not registered. Please advice.

Remove HTML formatting


Anyone know how to remove html-formatted-string to plain text programatically?

I want to get the same result as if i ctrl+a in a browser's page and then ctrl+v in a notepad.

I was googled how to strip html string, but didn't find the good result.

Removing tag using regex: "<(.|\n)*?>" causes some problems:

* The html-table is not nicely converted to tabbed plain text. It produces *crazy* table in plain text.

* the html-alternate-image lost

* the list ( <ul> & <ol> ) is not conveted well. No numbering or bullets in plain text

Function to return number


I am trying to create a function that  return the number part within / / from a url if exist:

For exmple:

http://www.mydomain.com/Mobile_Exec/1234/Orange_revamps_business_website.aspx SHOULD RETURN "\1234\"

http://www.mydomain.com/News/Orange_revamps_business_website.aspx    SHOULD RETURN "\\"

http://www.mydomain.com/News/Features/627362/Orange_revamps_business_website.aspx SHOULD RETURN "\627362\"

I prefer if possible to use regular expression. Any help would be really appreciated.

IIS - sharepoint/default website port number confusion



I have MOSS 2007 installed with IIS V7.

My default web site port is 80. When I created a new web application for my main sharepoint portal I also set it to 80. So obviously now the default web site port shows as stopped in IIS and it won't start.

What are the best practices. Should I change the port number for my portal to something else? I mean is it even a good idea to have sharepoint on port 80? If so, how do I go about changing the port number for my portal site?

any help appreciated.

Reading/writing Word documents - keeping formatting


I've done some reading about reading from and writing to a Word doc. The reading from worked without issue:

string strPath = "Test.doc";
FileStream fStream = new FileStream
    (strPath, FileMode.Open, FileAccess.Read);
StreamReader sReader = new StreamReader(fStream);
string text = sReader.ReadToEnd();

But of course this is just a string, without any formatting information included. Writing to the document using a StreamWriter worked, but I received errors when opening the document.

I've also read that trying to perform actions on an Office document on a server without the Office products installed on it can result in mayhem. I'm working on a MVC application that will allow users to upload documents to the server, work on them, save their work and email it around. That doesn't specifically require the need to read/write programmatically, but for certain application functions I do need this. Any helpful suggestions are appreciated.

Rounding a number based upon it's midpoint


I need to round down, or round up a floaitng point number to it's closest integer value.
So for example 3.49999 is closer to 3 so it would round down to the integer 3.
3.5002 is closer to 4 so this would round up to the integer 4.

I do not need to be concerned negative numbers. Can someone show me how to do this?


Here are more examples to make clear what I am talking about



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