|
This will round it mathematical, but you also can use the Math functions or just modify the string.
string text = "1,5345";
double d;
if(double.TryParse(text,System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.CurrentCulture, out d))
{
int inums = Convert.ToInt32(d);
}
All the best,
Martin
|
|
|
|
|
ok i will
Becoming Programmer...
|
|
|
|
|
Data Entry Validation.
If decimals are illegal values prevent or validate their entry, don't leave your users guessing what the expected entry is.
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
|
thanks but i think you replied it after 1 month xD
Becoming Programmer...
|
|
|
|
|
Hi!
I've one question:
I want to send a request to DNS server with type NAPTR. But I don't know how. Help me, plz!!!
|
|
|
|
|
Please explain me the use of keyword internal protected and internal with an example ??
what is the difference between internal protected and internal ??
Can construstor be declared internal protected/internal ?? why or why not???
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
google broken ?
internal means visible only within the current assembly. protected internal presumably means visible only to derived classes within the current assembly.
Yes, you can make a constructor whatever you like. If it's protected, obviously only derived classes can be created, unless a factory method is provided.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Sir actually , google too provides this much information.as far as any example is concerned that , upto this limit i can use the internal member vaiables, and till this limit , i can make use of internal protected.
I mean if u provide any small example , any example.Please
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Is what you mean to ask, why would you use these things ?
Internal is useful for things you want to hide, but which should be visible within a module. For example, if you have a seperate data layer class that you want to be visible only to the entity classes within your module. internal protected allows you to create a base class which is derived from within your module, but which clients of your module are unable to extend.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Christian Graus wrote: protected internal presumably means visible only to derived classes within the current assembly.
I knew I wasn't the only one.
protected internal means it's visible everywhere within the same assembly *and* to all subclasses.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
'internal' means any class in the same assembly can access it.
'protected' means any class that any inheriting class can access it.
'internal protected' (or 'protected internal' ) means that any class in the same assembly AND any inheriting class can access it.
example for internal : If application contains 2 files
Assembly1.cs, Assembly2.cs
If the first file contains a class (base class) (i.e. in assembly1)
The second file is in assembly2…. If u want to access the base class of assembly1 in assembly2 then u can’t access it…this is the concept of Internal…
In .Net 2.0 you can have 'friend' assemblies. If you make an assembly a 'friend' of another then it will have access to anything marked internal as if it was in the same assembly
pavan...
|
|
|
|
|
Assembly1 means Assemblyinfo.cs
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
You could have atleast rewritten what I gave rather than plagiarizing[^] my answer word for word
|
|
|
|
|
hello, I'm quite familiar in connection and manipulation of VB and MS Access. Actually I use ADODB connection and Im using the basic database manipulation functions like MoveNext, MoveLast, Update, AddNew and something like that. Could you please help me doing it in C#? I'm really still a noob in C# specially when it comes to database. could you please teach me how to connect, add, delete, insert, filter and other basic stuffs? I would be very thankful if you'll send me a sample program with explanation. Thanks in advance!
oyams
|
|
|
|
|
You're describing ADO. ADO.NET works completely differently. There are tons of tutorials on the web, just google 'access C#'.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
oyams90 wrote: if you'll send me a sample program with explanation
Nobody here will do that, but you could find some articles here on CP or on the net I'll bet.
You would like to search on "ADO.NET", "C#" and "OleDb".
hope this helps
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
Hi
I Want Read / Add a Fonts file i.e; *.ttf to the Resource file
so that my application can read fonts file for the resx but not
from windows\fonts\
thank u
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
As far as I know the .NET framework does not have the functionality to read ttf files embedded in applications. You can however have the fonts in a local folder (relative to your application and not of the windows\fonts folder), and then use a PrivateFontCollection class to handle the fonts.
Consider looking at MSDN: http://msdn2.microsoft.com/en-us/library/ms534992.aspx[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
how to call storeprocedure in page load event
i have string strCmd = "exec rpt_OnlineStoreActivity '01/01/2000', '07/30/2007'";
can some if this is wirght away to do it.
thank you
|
|
|
|
|
may i see u'r stored procedure code?
if u use stored procedure for the query,next thing u must do is call stored procedure..or i'm missing something about your question?
for example on page load events i write this code:
string Connection = ConfigurationManager.ConnectionStrings["Connect"].ConnectionString;
SqlConnection conn = new SqlConnection (Connection);
conn.Open();
SqlCommand cmd = new SqlCommand("sp_SelectAllData", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
note : i already have a stored procedure name sp_SelectAllData in my database
but try using Data Access Layer, Bussiness Logic..so if u want some change in u'r interface u don't have much trouble to change your code
Kind Regards,
Tomi
|
|
|
|
|
I have an application which is written in C++ and consists of 5 DLLs and an EXE. In total, there's around 150-180k lines of code, so the app is far too large to simply port to .NET. Also, there are several other applications dependent on the 5 DLLS (these are also written in C++). However, I need to use some .NET components (specifically the 3rd party ASPOSE.Pdf, ASPOSE.Words, ASPOSE.Cells, and ASPOSE.Slides libraries). What is the best strategy for integrating these components into my application? Would a simple rebuild with /CLR option get me very close? (FYI: So far my .NET experience has been somewhat limited and has involved development of entire programs/websites in .NET, no need to integrate pre-existing code.)
Thanks for any advice you can offer.
|
|
|
|
|
I'd say yes. You can even built a C++/CLI dll and import it into your C++ app, making it the bridge.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
|
i am useing sp to collect data to gridview but it does not bind data to gridview.i can see it on page than when i debugg it does't display any thin in web site. can some one tell me what i am doing wrong?
thank you
|
|
|
|