|
|
I am trying to display a number with two places to right of decimal. When the number diplays it truncates the trailling zero. I want to see .50 but I see .5
after I changed my datatype in the database to decimal from float. the number shows up like 2.25000009944
can someone tell me how do I display 1.50 with the zero in the database and the UI (web form). I tried looking for formatting in help but i can seem to get it right.
Thanks
|
|
|
|
|
Hi,
I think you should look around string.Foramt() methode which can have parameter like NumberFormatInfo MSDN
Or, like this example, you can use the ToString() methode :
string NumberPrettyPrint(int number){
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
nfi.NumberDecimalDigits = 2;
return number.ToString("N", nfi);
}
Hope that can help
|
|
|
|
|
I have loaded crystal report with a line graph in C#. now i want to change graph from line graph to bar or any other graph using C# code.what should i do.in other words i want to pass chart type from C# to crystal report . Have any body some idea about it
|
|
|
|
|
Hi,
It's been a while since I've posted in here!
Last Time I was using Visual Studio 2003.NET and mainly using C# Version 1.1
and C++.NET 1.1.
I'll be getting Visual Studio 2005 this week hopefully.
I know it came out in November, but Im not from the US, good ole England, and we're just getting over here.
Amazon UK Visual Studio 2005 Release Date : January 27, 2006 -
Visual Studio 2005 @ Amazon UK
I'm now coding in C# 2.0, using Visual C# Express and Visual Basic.Net Express
and hopefully moving onto C++.NET 2.0 as well. The Managed Framework looks wicked!
Anyway all that has nothing to do with why im posting.
Im trying to write a Plugin for MSN Messenger Plus plugin that changes the personal message like the 'What I'm Listening To' when you use Windows Media Player or Itunes.
I've seen a .NET plugin that changes the nick, but i'm wondering if anyone has found out how to change the personal message. Any .NET Language will be fine.
Thanks Tom
|
|
|
|
|
Its Okay!
I did look around and saw documentation for something called Toaster!
I thought this would bringing up a dialog box in MSN Messenger toasting to someone!
But the actual feature for the personal message is called Toaster, so its okay.
But please provide content if you like.
Thanks again
Tom
|
|
|
|
|
Please show me how to call ExitWindowsEx function in user32.dll in .NET.I've tried this:
[DllImport("user32.dll")]
private static extern int ExitWindowsEx(int dwReserved, int uReturnCode );
public static void Main()
{
ExitWindowsEx(0,0)
}
This previous code can log off the computer but when i change it to ExitWindowsEx(1,0) nothing happen.i dont understand clearly about these parameters's meanings.So please explain more clearly for me.Tnx lots
|
|
|
|
|
|
Hi there,
While you want to get help from CodeProject, but your username can make people here really annoyed, it's not polite (or do you think people don't know Vietnamese?)
|
|
|
|
|
minhpc_bk wrote: (or do you think people don't know Vietnamese?)
Regards,
Nish
|
|
|
|
|
Hi Nish,
You probably get shocked when you know what his id means in English. It's currently in Vnese, and in English it means "f*ck your mom" ! However, I think he might be joking when he picked up this id for himself.
|
|
|
|
|
HI all.I'm really sorry.I dont mean that because i'm not vnese and i dont understand its meaning.I've changed it already.However pls help me with this problem
|
|
|
|
|
|
minhpc_bk wrote: You probably get shocked when you know what his id means in English. It's currently in Vnese, and in English it means "f*ck your mom" ! However, I think he might be joking when he picked up this id for himself.
Egad! That is bad!!!
Regards,
Nish
|
|
|
|
|
Hi everybody!!!
I have a DataSet with only one DataTable in it.
The DataTable has many DataColumn and one of those is binded to a ComboBox.
Below the DataColumn...
DataColumn protocolloColumn = new DataColumn("protocollo");
protocolloColumn.DataType = System.Type.GetType("System.String");
carDataTable.Columns.Add(protocolloColumn);
...and the Binding
this.protocolloComboBox.DataBindings.Add(new Binding("SelectedValue", carDataSet, "car_models.protocollo"));
The ComboBox is populated with some string.
When I select a value from the combobox, this value is not stored in the dataset.
Can anybody help me?
|
|
|
|
|
Ive built an client/server application where several clients are sending live data about itself to the server. Everything is working well on the local network using MSMQ. Im using private queues since i dont need any ack or transactions. The problem is i want everything online. So i changed the formatname to http and used the built in http support in msmq. This actually worked fine when i tried with a computer not behind a firewall or a router (win xp). But when trying to connect to a computer withtin a router (win2k3) it doesnt work. The message stays in the outgoing queue on the client. Ive set all the permissions and the port is of course open (i can enter the ip + /MSMQ/ and wont get an error).
Anyone know what could be wrong?
Or, if anyone have another idea how to do this it would be appreciated. Also, what i really want to do is to be able to recieve messages over http (instead of only beeing able to send them). Because as it is now, i can only put the message trough http, but must recieve them trough the local network using another format name. Please help
/Andreas Ö
|
|
|
|
|
I'm trying display timestamps using the following format 20060109 152412Z (year month day hour minute second Z = zulu/gmt time). The closest I've got is to set the System.Globalization.CultureInfo.DateTimeFormat.FullDateTimePattern to "yyyyMMdd HHmmss" which does everything except the timezone change. In addition to not knowing how do to the timezone thing, convert.ToDateTime() won't parse strings in this format.
|
|
|
|
|
Create a DateTimeFormat object and set the custom format on that, then you can use it to format and parse strings.
For time zone convertsion, look into the TimeZone class.
---
b { font-weight: normal; }
|
|
|
|
|
I am. My main form constructor calls this code:
<br />
System.Globalization.CultureInfo info;<br />
info = System.Globalization.CultureInfo.CurrentCulture;<br />
info = new System.Globalization.CultureInfo(info.LCID, true);<br />
info.DateTimeFormat.ShortTimePattern = "HHmmss";
info.DateTimeFormat.LongTimePattern = "HHmmss";
info.DateTimeFormat.ShortDatePattern = "yyyyMMdd";
info.DateTimeFormat.FullDateTimePattern = "yyyyMMdd HHmmss";
System.Threading.Thread.CurrentThread.CurrentCulture = info; <br />
<br />
DateTime test = Convert.ToDateTime("20060109 170501");<br />
The converions call on the last line throws a System.FormatException: {"String was not recognized as a valid DateTime." }
|
|
|
|
|
Odd, I really thought that would work. Perhaps it's the tricky date format.
You can use ParseExact:
DateTime test = DateTime.ParseExact("20060109 170501", "yyyyMMdd HHmmss", null);
---
b { font-weight: normal; }
|
|
|
|
|
That way worked. I'm going to kick the convert problem over to the MSbug tracker and see what they say. I can't see any way they could call this behavior a 'feature', then again Ctrl key shortcuts working for invisible menu items apparently are, and weren't changable because it might break intended functionality in an existing app. Anyone intentially using that behavior deserves to have more than just thier app broken, IMO.
|
|
|
|
|
Guffa wrote: For time zone convertsion, look into the TimeZone class.
That looks like it covers most of what I want, there doesn't appear to be a way to set the app to always read/write/display in a TZ other than the system default. The number of places where I'm using date/times is small enough that it's not a prohibitive change to hardcode them seperately, but I prefer not to do so whenever possible.
|
|
|
|
|
I need writing to COM port (COM1 for example) to send AT commands to modem, please help me doing that. I heared, that i can open COM as a file and write into it, but when i tryed this in C# - an error occured: "FileStream will not open Win32 devices such as disk partitions and tape drives".
Help me please.
Thanks.
SAns
|
|
|
|
|
Use the SerialPort[^] class.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|