|
The float data type
float data type is the first of 3 data types that can store floating point numbers and actually this is the smallest of the 3 types. float variables store floating point numbers from 1.5 times 10 to the 45 th (±1.5 × 10-45 ) to 3.4 times 10 to the 38 th (±3.4 × 1038 ) in 32 bit. And this type has a precision to 7 numbers.
The double data type
double data type variables can store floating point numbers from 5 times 10 to the 324 th (±5.0 × 10-324 ) to 1.7 times 10 the 308 th (±1.7 × 10308 ) in 64-bit. And this type has a precision to 15-16 numbers.
The decimal data type
decimal data type variables can store 1 times 10 to the 28th 1.0 × 10-28 and 7.9 times 10 to the 28 th 7.9 × 1028 in 128 bit. If you think about this type you will note that it has a greater precision and a smaller range and that’s we exactly needs for financial calculations also note that decimal data type has a Precision of 28-29 significant digits.
|
|
|
|
|
One more quick thing on Decimal datatypes.
Although the C# language considers this a primitive datatype, the CLR does NOT. From a practical standpoint, this means that manipulating Decimal datatypes is slower than working with the other datatypes. Also, the checked and unchecked operators, and compiler switches have no effect on Decimal datatypes, which ALSO means that Decimal datatypes ALWAYS throw an OverflowException if the operation can't be done safely.
I was surprised by this, I am pretty sure I read it in Jeff Richter's book, and played with it some and he's right. I HATE it when that happens!
|
|
|
|
|
Hello!
I got a problem with the lines below. I don´t know how to use VirtualAllocEx in C# , because I must allocate a certain space for a struct and an item (both are pointers).
I´d like to know if anyone got any idea how I can do the same thing in c#.
This code is from: http://www.codeproject.com/threads/int64_memsteal.asp?df=100&forumid=29535&exp=0&select=727974&mpp=50#xx727974xx[^]
"Stealing Program's Memory"
LVITEM lvi, *_lvi;
char item[512], subitem[512];
char *_item;
HANDLE process;
_lvi=(LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM), MEM_COMMIT, PAGE_READWRITE);
_item=(char*)VirtualAllocEx(process, NULL, 512, MEM_COMMIT, PAGE_READWRITE);
Thank you!!
|
|
|
|
|
If you are trying to allocate memory in an unmanaged process, you can probably use PInvoke[^] to make it work. If the memory you need to allocate will be in another managed process, then those unmanaged APIs will not work. What you would need to do in that situation is, probably, use .NET remoting to communicate between the two managed processes.
Josh
|
|
|
|
|
Hi Josh, thanks for the reply!
What I´m trying to do is read a TreeView(Folder Browser Dialog) from another program.
By reading each item´s text I can select a especific Folder.
I noticed that usual codes did not catch anything from outside my program. For instance:
SubString Text = new SubString(255);
tvItem.pszText = Text;
SendMessage(TreeHandle, TVM_GETITEM, 0, ref tvItem);
This code works perfectly if the treeview is in your application, but SendMessage returns only false if the treeview is in another application(process).
Thank you
|
|
|
|
|
I have seen tabstrip Control Visual Studio Style 2005.
Can anyone tell me how i can get tabstripControl with tabs on downside.
|
|
|
|
|
SravanKrishna wrote: Can anyone tell me how i can get tabstripControl with tabs on downside
tabControl1.Alignment = TabAlignment.Bottom;
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
|
Hi,
Can any body tell me please how can i use multi column dropdown box against a column in datagrid view. It means when i click on the button displayed on the right side of the column, then that multi column drop down be displayed.
Waiting for reply....
Regrads,
Shahid
Ever Respect the elders
|
|
|
|
|
Can someone point me in the right direction? I would like to have a button on a ToolStrip that drops down a single ToolStripMenuItem that has a TracBar instead of a standard text link. Is this possible or would this need to be done completely from scratch.
|
|
|
|
|
Hi All !
I want to get the value of the last Record (ID)From a table , for example if the Last ID=35 , how i can get the value of it from a table ?
thanks a lot .
s_mostafa_h
|
|
|
|
|
try this :
sqlDataAdapter1 = new SqlDataAdapter("select max(IdColumnName) from TableName", sqlConnection1);
DataSet ds = new DataSet();
sqlDataAdapter1.Fill(ds);
int MaxID = Int32.Parse(ds.Tables[0].Rows[0][0].ToString());
Tamimi - Code
|
|
|
|
|
I assume you're doing this because you want to then use that ID to create associated records in other tables?
If so, then write a stored proc that does the insert and then returns the ID of the record added using either @@IDENTITY or SCOPE_IDENTITY()...
In not (or not using SQL Server), then nevermind.
|
|
|
|
|
If you have added a record and want to find out the id that the record recieved:
Access: select @@identity
MySQL: select last_insert_id()
MSSQL: select scope_identity()
Getting the largest id after adding a record is a very very bad method to get it's id. It works flawlessly when you are testing the system by yourself, but in a multi user system you will get the wrong id sometimes as another user added a record at the same time. The more users, the more frequent the errors will be.
---
b { font-weight: normal; }
|
|
|
|
|
thanks for ur reply ..
atlast , do I use this ?
<br />
"select max(IdColumnName) from TableName"<br />
s_mostafa_h
|
|
|
|
|
No, not if you just added a record and want to find out what id it got. Then you use one of the queries I showed.
You can use it if you want to find out what the highest id is in the table, but that information really isn't very useful. One millisecond after you got the value, another record could be added by someone else, and the information is outdated.
---
b { font-weight: normal; }
|
|
|
|
|
Does anyone know how to safely inherit from a "Form"? When I do this my owned Form stops be robust in Design mode.
Thanks for advance.
HZ
|
|
|
|
|
hi to all,
i'm working with xml data. i extract the data from an sql server data base via a stored procedure.
the result of the executed procedure is an XmlTextReader.
i'm trying to copy the content of the into a physical file on the hard disk.
i tried two solution.
first one consist on loading the reader into an XmlDocument and save it to the disk
the second consist on a loop on the reader and creating the xml file manually.
the problem is : when the procedure brings a lot of data,
sometimes i have some tags or attributes
wrapped between two lines.
like this : >mytag first_attrib="1" second_attrib="2" third_attr
ib="3"/>
or >anothertag first_attrib="1" second_attrib="2"/> >an
othertag third_attrib="3" fourth_attrib="4"/>
you can notice that in the first example the attribute is wrapped on two lines
and in the second case the tag is wrapped on two lines
so when i tried to load the reader into an xmldocument, i got an error message.
and when i tried to loop through the reader, i also got an error when the reader
arrive to the wrapped attribute (third_attrib in my examples)
the question is how can i solve the problem of wrapped tags or attributes ?
does anyone has a solution to my problem ?
best regards and thanks in advance
fady
|
|
|
|
|
hi to all,
i'm working with xml data. i extract the data from an sql server data base via a stored procedure.
the result of the executed procedure is an XmlTextReader.
i'm trying to copy the content of the into a physical file on the hard disk.
i tried two solution.
first one consist on loading the reader into an XmlDocument and save it to the disk
the second consist on a loop on the reader and creating the xml file manually.
the problem is : when the procedure brings a lot of data,
sometimes i have some tags or attributes
wrapped between two lines.
like this : <mytag first_attrib="1" second_attrib="2" third_attr
="" ib="3">
or <anothertag first_attrib="1" second_attrib="2"><an
othertag="" third_attrib="3" fourth_attrib="4">
you can notice that in the first example the attribute is wrapped on two lines
and in the second case the tag is wrapped on two lines
so when i tried to load the reader into an xmldocument, i got an error message.
and when i tried to loop through the reader, i also got an error when the reader
arrive to the wrapped attribute (third_attrib in my examples)
the question is how can i solve the problem of wrapped tags or attributes ?
does anyone has a solution to my problem ?
best regards and thanks in advance
fady
|
|
|
|
|
Hi,
I have a UserControl that contans an image and CAN also contan text ( using DrawString()).
I have a panel that has several of these UserControls that I can move around with a mouse ( using drag-drop).
What I would like to do, however, would be to be able to rotate the UserControl : ie: left 30 degrees or right 30 degrees or even upside-down.
I see various tools using Graphics/Matrix to be able to do that within a window, but I still end up with a regular square with an image in it.
My user control is basically a button and I would like to show the button at a 30 degree angle or upside down based on other logic.
Thanks
Gary
Just for the fun of it !
|
|
|
|
|
Sounds like you're working on a fun app! Unfortunately there is no support in WinForms (or Win32 for that matter) for rotating controls. The best you could do is display images instead of the Button (user control). Since bitmaps can be rotated, you could probably, with lots of effort, make it look and feel pretty cool using images.
If you have the option, I'd say develop this app using WPF. WPF has huge support for transforms, animations, and all types of visually exciting effects. I've been studying it now for about a month and am more and more amazed by it every day!!
Josh
|
|
|
|
|
I want to run an Office Communicator inside a User Control. I do not want it to open as a new window, but instead inside my panel. This is the code I have tried:
Process comm = new Process();
comm.StartInfo.CreateNoWindow = true;
comm.StartInfo.FileName = @"C:\Program Files\Microsoft Office Communicator\communicator.exe";
comm.Start();
The problem is that the Communicator is opened, but not inside my User Control. Does someone know how to solve this problem?
|
|
|
|
|
What you are trying to do is wrong, this is conceptuelly wrong.
Try to do the communicator as an embed control to your application,
HZ
|
|
|
|
|
|
How to set endtime time to playing audio file ...
|
|
|
|