|
pankaj.indore wrote: Dim d as double
d=5/3
messagebox.show(k.tostring())
result 1.666666667
but in C# it give 1 whyyyyyyyyyyyyyyyy
Christian already explained it to you.
5 and 3 are both integers. If you do integer division your result will be an integer.
1.667 is not an integer.
pankaj.indore wrote: universe know this 5/3 = 1.666666....
Only when it is doing floating point division. When it is doing integer division the result is 1.
Obviously VB performs floating point division, while C# uses integer division (unless told not to, by having the values cast before).
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
This VB code:
d = 5 / 3
is equivalent to this C# code:
d = (double)5 / (double)3;
The / operator in VB always does floating point division, converting the operands if needed.
---
single minded; short sighted; long gone;
|
|
|
|
|
actually i m new to dot net
i m using oledb connection
and my query is
"select * from tableabc where name = ? and id = ?"
i dont know how to map these parameters to my command object can any body tell me please
thanks
hello
|
|
|
|
|
Before posting your questions here in the forum did you read the guidlines of how to post the question in the forum.
pls make your subject with suitable topic relevant to your question.
Don't name your subject as hi, hi all.
pls be specific in your subject and post the questions here.
Regards,
Satips.
|
|
|
|
|
Create OleDbParameter objects. Assign them a data type and a value and add them to the collection of parameters of the command object IN THE EXACT ORDER THEY APPEAR IN THE STATEMENT.
|
|
|
|
|
In OleDb you use named parameters:
"select * from tableabc where name = @Name and id = @Id"
Use "@Name" and "@Id" as names when you create the parameter objects for the command.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi.
Is there a way to get the number of the print jobs pending for a specified installed printer?
Thanks.
|
|
|
|
|
|
Martin# wrote: Hope it helps!
It sure helped. Thanks a lot!
|
|
|
|
|
hi all
i am passing two parameters via responce.redirect but its not working can
any body please tell me the exzact syntax
Response.Redirect ("Employee.aspx?id= "+ this.DropDownList1.SelectedValue + "?name=" + this.TextBox1.Text);
hello
|
|
|
|
|
ghumman63 wrote: onse.Redirect ("Employee.aspx?id= "+ this.DropDownList1.SelectedValue + "?name=" + this.TextBox1.Text);
Response.Redirect ("Employee.aspx?id= "+ this.DropDownList1.SelectedValue + "&name=" + this.TextBox1.Text);
Regards,
Satips.
|
|
|
|
|
ghumman63 wrote: Response.Redirect ("Employee.aspx?id= "+ this.DropDownList1.SelectedValue + "?name=" + this.TextBox1.Text);
Use an ampersand (& ) symbol to append the fields after the first one as follows:
Response.Redirect ("Employee.aspx?id= "+ this.DropDownList1.SelectedValue + "&name=" + this.TextBox1.Text);
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Thats what i too have mentioned it.
Regards,
Satips.
|
|
|
|
|
Dear Satips,
See the time delay between you and me.
This shows that we are in the same wavelength.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
yeah i didn't notice the time. Ok.
Regards,
Satips.
|
|
|
|
|
Hello everyone,
I'm starting to work on a project. This project will incorporate so many components from previous work of another colleague. He did all his work in a separate project. Basically,I'm trying to
do a wizard-based version of hsi work with screens and neat menus and so on. I was wondering how I can use functions and events that he programmed into my project without having to hard-code or copy code into my own project.
For example, I want to call an event function from his work when i click a "next" button in my project.
I hope the questions is clear enough. and Thanks for any help. It will be much appreciated.
|
|
|
|
|
Recompile his code as a dll/dlls.
Now include reference those dlls in your code.
You might have to make some minor changes to compile it as a dll. (All this on the assumption that his code is currently compiled to an executable, you have good understanding of his code)
rAm
i Think, i Wait, i Fast -- Siddartha
|
|
|
|
|
Hi guys, whats up ? How can I change the Input Language From English to Farsi Or other languages, a friend told me to use this code (This is a delphi ample)
LoadKeyboardLayout('0000040c', KLF_ACTIVATE);<br />
Application.BiDiKeyboard := '0000040c';
Does the same code works in C#, if so where can I get a sample? Please help me out !
Thanx
Mr.K
|
|
|
|
|
|
Hello Everybody,
In my program i have to encrypt the password and i have to store it in the SQL server database.
It should by very strong.
Could you please give me a hint
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
The Cryptography namespace is full of options. MD5 is definately not a secure option, FWIW.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you Christian.
What do you mean by FWIW, is it a encryption method. plz don't mistake me
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
For What It's Worth = FWIW
Use SHA256 - that's pretty strong - we use it in my company (note I'm not saying WHICH company)
Mark
|
|
|
|
|
Thank you for your kind suggesstion
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Mark Greenwood wrote: we use it in my company (note I'm not saying WHICH company)
Most companies use this I suspect - as it is very easy to use and very strong. Usually with a strong password as well.
|
|
|
|