Click here to Skip to main content
15,918,123 members
Home / Discussions / C#
   

C#

 
GeneralRe: Connecting from Visual Studio 2010 to SQL Server Management Studio Pin
PIEBALDconsult21-Apr-10 14:40
mvePIEBALDconsult21-Apr-10 14:40 
GeneralRe: Connecting from Visual Studio 2010 to SQL Server Management Studio Pin
Dave Kreskowiak21-Apr-10 17:22
mveDave Kreskowiak21-Apr-10 17:22 
GeneralRe: Connecting from Visual Studio 2010 to SQL Server Management Studio Pin
Darrall22-Apr-10 4:46
Darrall22-Apr-10 4:46 
QuestionTrasnfer Data in datagrid in form1 to Text box in form2 Pin
shahramkeyboard21-Apr-10 8:21
shahramkeyboard21-Apr-10 8:21 
AnswerRe: Trasnfer Data in datagrid in form1 to Text box in form2 Pin
OriginalGriff21-Apr-10 8:48
mveOriginalGriff21-Apr-10 8:48 
AnswerRe: Trasnfer Data in datagrid in form1 to Text box in form2 Pin
DaveyM6921-Apr-10 11:01
professionalDaveyM6921-Apr-10 11:01 
Questioncrystal reports Pin
jojoba201121-Apr-10 7:52
jojoba201121-Apr-10 7:52 
QuestionConverting Pixel to twips Pin
jojoba201121-Apr-10 7:01
jojoba201121-Apr-10 7:01 
AnswerRe: Converting Pixel to twips Pin
Henry Minute21-Apr-10 7:17
Henry Minute21-Apr-10 7:17 
GeneralRe: Converting Pixel to twips Pin
Not Active21-Apr-10 13:00
mentorNot Active21-Apr-10 13:00 
GeneralRe: Converting Pixel to twips Pin
Dan Mos21-Apr-10 13:15
Dan Mos21-Apr-10 13:15 
AnswerRe: Converting Pixel to twips Pin
Luc Pattyn21-Apr-10 7:48
sitebuilderLuc Pattyn21-Apr-10 7:48 
QuestionCreating a checklist using checkbox tool in csharp smart device project Pin
Tunisien8621-Apr-10 6:06
Tunisien8621-Apr-10 6:06 
AnswerRe: Creating a checklist using checkbox tool in csharp smart device project Pin
Tarakeshwar Reddy21-Apr-10 9:04
professionalTarakeshwar Reddy21-Apr-10 9:04 
GeneralRe: Creating a checklist using checkbox tool in csharp smart device project Pin
Tunisien8621-Apr-10 22:53
Tunisien8621-Apr-10 22:53 
GeneralRe: Creating a checklist using checkbox tool in csharp smart device project Pin
Tarakeshwar Reddy22-Apr-10 6:23
professionalTarakeshwar Reddy22-Apr-10 6:23 
AnswerRe: Creating a checklist using checkbox tool in csharp smart device project Pin
Tunisien8622-Apr-10 6:27
Tunisien8622-Apr-10 6:27 
QuestionHow to pad a string with zeroes Pin
jkpieters21-Apr-10 4:41
jkpieters21-Apr-10 4:41 
AnswerRe: How to pad a string with zeroes Pin
OriginalGriff21-Apr-10 4:51
mveOriginalGriff21-Apr-10 4:51 
GeneralRe: How to pad a string with zeroes Pin
jkpieters21-Apr-10 4:58
jkpieters21-Apr-10 4:58 
GeneralRe: How to pad a string with zeroes Pin
OriginalGriff21-Apr-10 5:15
mveOriginalGriff21-Apr-10 5:15 
To do this while keeping it as a string will be messy:
string x = "456.78";
string[] parts = x.Split('.');
string whole = parts[0];
string decpart = parts[1];
string y = new string('0', 5 - whole.Length) + whole;
string z = decpart + new string('0', 4 - decpart.Length);
string padded = y + "." + z;
And that has no error checking!
To convert to double and back is probably the best way:
string x = "456.78";
double d = double.Parse(x, System.Globalization.CultureInfo.InvariantCulture);
string padded = string.Format("{0:00000.0000}", d);
But you will have to be absolutely sure that your number strings are all in "nnn.nn" format - remember that some cultures use "nnn,nn" which would bolox you right up! (That may be why your conversion gave funky results...)
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace

C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

GeneralRe: How to pad a string with zeroes Pin
PIEBALDconsult21-Apr-10 6:00
mvePIEBALDconsult21-Apr-10 6:00 
GeneralRe: How to pad a string with zeroes Pin
OriginalGriff21-Apr-10 6:07
mveOriginalGriff21-Apr-10 6:07 
GeneralRe: How to pad a string with zeroes Pin
PIEBALDconsult21-Apr-10 6:17
mvePIEBALDconsult21-Apr-10 6:17 
GeneralRe: How to pad a string with zeroes Pin
OriginalGriff21-Apr-10 6:24
mveOriginalGriff21-Apr-10 6:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.