|
Hi
I am doing a division and the result gives me an answer with decimal places. How do I remove all the characters after the decimal place?
|
|
|
|
|
double d = 13/7;
int i = Convert.ToInt32(d);
|
|
|
|
|
|
That depends.
Do you want to truncate or round the value?
Are you going to process the value further, or is it only to be displayed?
If you want to truncate the value (remove decimal part), cast the value to int or use Math.Truncate.
If you want to round the value (to nearest integer), use Math.Round.
If you want to round it only for displaying it, do the rounding when you convert it to a string, using ToString("n0").
---
b { font-weight: normal; }
|
|
|
|
|
hi
How to invoke post back.I need some function like invalidRect in win app.
thank you for help
best regards
|
|
|
|
|
Form.Invalidate(Rectangle)
|
|
|
|
|
Hi All,
A Text Box on a Form of mine is bound to a Numeric SQL Server field. Is there any easy way to Format the contents to : '9.00', and Not '9.0000' as it is at the moment?
[I Bind in code so was thinking I could include formatting there]
Thanks
Jonny
|
|
|
|
|
Take a look at this MSDN topic covering Numeric Format Strings[^].
There may also be a way doing the formatting during data binding. I remember doing something like that on my website. But to help you specifically with that some code would be helpful.
www.troschuetz.de
|
|
|
|
|
Thanks Stefan,
Heres the code :
this.textBoxAmount.DataBindings.Add("Text", myBindingSource, "Amount")
There is another .Add Constructor, which includes 'formatString', so perhaps I can use that?
Thanks
Jonny
|
|
|
|
|
|
How can I run a Select query from a datatable so that it only brings the
fields I want?
ALBSHAH
|
|
|
|
|
SELECT list_of_fields_you_want_seperated_with_comma FROM ...
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi there
Why do you need this functionality?
If there isn't too much data in the table, you could copy the table and then remove the columns you didn't need, and then Select from it:
DataTable newTable = oldTable.Copy();
newTable.Columns.RemoveAt(1);
newTable.Columns.RemoveAt(3);
dgDisplay.DataSource = newTable.Select("WHERE age < 50");
Kind regards - Jakob
*********************************************
Three kinds of people in the world:
- Those who can count..
- Those who can't!
10 kinds of people in the world:
- Those who understand binary
- Those who don't
|
|
|
|
|
I am using Infragestics Ultra webGrid and one of the column in that gird is Hyperlink.
I want to pass multiple values in Navigate URl
How do i do that???
Thanks
|
|
|
|
|
As you have paid for it it should be best to ask Infragestics...
|
|
|
|
|
Hi,
How can i create a pop up menu like the one of Mail button on IE?Please help me.
Thanks,
LMHP
|
|
|
|
|
Hi,
i want to create a pop-up menu like the Mail button for the IE. How can i do this?
Thanks in advances.
LMHP
|
|
|
|
|
comboBox1.DataSource = AnyDataset;
comboBox1.DisplayMember = "Name"
comboBox1.ValueMember = "Id"
while writting this code.the selectedIndexchnaged event of the combo fire.
i don't want the same.I want to event to fire when the item is selected from the interface.
Rohin
|
|
|
|
|
Check visibility of form, when hanling event, or use flag:
updating = true;
comboBox1.DataSource = AnyDataset;
comboBox1.DisplayMember = "Name"
comboBox1.ValueMember = "Id"
updating = false;
....
public void OnSeletedIndexchanged(...)
{
if (!updating)
{
// handling code
}
}
Best regards, Alexey.
|
|
|
|
|
How are you Friends in this forum ?
i need to know how can i make pc to pc calls in my application!!!
http://www.openh323.org[^]
i have seen this great website but unfortunately i didn't
know how to add these two main classes pwlib.dll and openh323.dll to my project . the solution told me that these classes are neither supported classes Dll nor Com files . So anyone here has any information about .
how to establish a pc to pc calls.?
Any help will be greatly appreciated .
Human knowledge belongs to the world.
|
|
|
|
|
I am not able to find, how can I display DataGrid data Only using UpperCase .
rosenvas
|
|
|
|
|
There are two ways to do it
1. Get the data in upper case from the SQL Server - Use upper.
SELECT UPPER(RTRIM(au_lname)) + ', ' + au_fname AS Name
FROM authors
ORDER BY au_lname
2. Use DataBinder.Eval if you are databinding the datagrid
<%# DataBinder.Eval(Container.DataItem,"[au_lname]").ToString.ToUpper %>
-
बुरा जो देखण मै चला, बुरा न िमलया कोय,
जो मन खोजा आपणा तो मुझसे बुरा न कोय।
Translation
|
|
|
|
|
Thanks, but I am using Winforms. This property is not there. Is there any other way to do this except the first one you have given.
rosenvas
|
|
|
|
|
Please any one help me
i want to make .net project and compile it as com component, i tried many ways but no one of them work, so please help me because i want it urgantly
|
|
|
|
|