|
Hi,
Can you please give me a practical example to distingish below two methods..
Method 1
string.Format("something","Something");
Method 2
string.Format(CultureInfo.CurrentCulture,"something","Something");
Thanks!
Charith Jayasundara
|
|
|
|
|
Your first example simply calls your second example but with null as the first parameter. The second example exlicitly uses the current culture to render the formatting. In other words, if you ask it to format a number it will place the delimiters and decimal markers in the correct place and with the correct characters. For example, if your culuture is set to EN-GB then 1.234 will be rendered, whereas if your culture is NL-NL the same number would be rendered as 1,234
The .NET documentation has extesive examples of how to use Format and on formatting in general, that should be your starting point.
|
|
|
|
|
Hi,
Thank you for the reply. I understand how it works for numbers. But what is the purpose of setting the culture for normal strings?
Charith Jayasundara
|
|
|
|
|
Charith Jayasundara wrote: But what is the purpose of setting the culture for normal strings?
Because some people like consistency and will set all parameters explicitly all the time. Other than that, I don't think it makes any difference for strings.
|
|
|
|
|
Great
Thank you!
Charith Jayasundara
|
|
|
|
|
I have a table defined in a xsd that has an autoincrementing field that is used as the key to the table. The application uses ReadXML and WriteXML function to persists the dataset to an XML file. I am curious as to where the next value to use for the autoincrement field is persisted. I would have expected that when creating a new row in the table, the value for the ID field would be one greater than the highest value found in the table after the dataset is read in. It seems however to persist the highest value used in the past, even if those records have been deleted. In my application, when I create a new row, the ID field contains a 6071 when the highest value used before creating a new row was 5995. It does not appear that the autoincrement seed value is stored in the XML file itself, but where else would it be.
|
|
|
|
|
Hello everyone,
I am writing a backend program which will upload some big files to another server and I want to detect whether current machine's network is busy or not (I want to use relative non-busy time of current machine to upload files, as I do not want to impact other network related task on the machine as the upload file task priority is low).
Does anyone have any idea about how to check whether current machine is busy with network I/O? Should I check some performance counters?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Does anyone have any idea about how to check whether current machine is busy with network I/O?
You can try it with WMI . I think WMI will helps you out.
cheers,
Abhijit
|
|
|
|
|
Thanks Abhijit,
Do you have more detailed advice? Which API from WMI should I use?
regards,
George
|
|
|
|
|
I think You can Download "WMICodeCreator " , and can explore it.
cheers,
Abhijit
|
|
|
|
|
Thanks Abhijit,
I have downloaded the WMICodeCreator. But it is just a tool to list all WMI classes. There are a couple of network and network adapter related classes/properties. Which one should I use?
regards,
George
|
|
|
|
|
When you will select the classes, you will get corresponding properties that are available. And will get the code in right pane, Change the language to C# from Tool.
BTW: Check Senthil post also.
cheers,
Abhijit
|
|
|
|
|
Thanks Abhijit,
I noticed a lot of similar ones related to network and network adapter. As a newbie for this topic, I need exact information about which item should I use.
Any comments or ideas?
regards,
George
|
|
|
|
|
|
Senthil, Thats a good link !!!
cheers,
Abhijit
|
|
|
|
|
Agree, Abhijit.
But I have to use Windows Server 2003.
regards,
George
|
|
|
|
|
Sorry, Senthil.
I work on Windows Server 2003. Any solutons for this platform?
regards,
George
|
|
|
|
|
how can i load the data from data base table to my form
and show the data in text boxes without using the wizard
and how can I move between the rows
|
|
|
|
|
Please Search Google , Before Post Here.
Any way , there are few goods articles on Code Project it self, Hope This will helps you !!
Ref1[^]
Ref2[^]
cheers,
Abhijit
|
|
|
|
|
Dear All,
I have developed many database applications with vb6,vb.net,c# as front end and SQL SERVER and MySQL as Back End.
In truth i checked different tables and views in both SQL SERVER and MYSQL. I got better performance (fast) in SQL SERVER (my own check in a view which had 10000 records). I search alot and find out different ideas about them.
I found in some website that MySQL is faster than SQL SERVER while in other i found that SQL SERVER is faster in performance than MySQL.
In fact i dont know, now the question is what to use with c#, MySQL or SQL SERVER?
if MYSQL than which Engine?
Abdul Rahaman Hamidy
Senior Student Student in Computer Science
Kabul, Afghanistan
Software Developer
|
|
|
|
|
There is no 'correct' answer to your question.
If you are coding for fun/your own use, use whichever you prefer, for whatever reason you prefer it. It doesn't matter.
If you are coding in the commercial world it is unlikely that you will get a choice. On those rare occasions that the customer has no preference you should provide them with an honest comparison of the pros and cons of each system. In my experience that means they will elect to use MS SQL Server because of the perceived (often wrongly) support issues from a non open source product.
Honi soit qui mal y pongs - Evil to he who thinks it stinks
|
|
|
|
|
Here in Afghanistan, If you prefer MS SQL Server, then of course the price for that application will increase and if u get MySQL then u have to consider about the performance,replication,recovery and security.
My question is regarding only performance, that which one of these two RDBMS provides faster performance.
Thanks,
Abdul Rahaman Hamidy
Senior Student Student in Computer Science
Kabul, Afghanistan
Software Developer
|
|
|
|
|
IF you are using .net as a fron end, then best RDBMS option available is MS SQL. There is a performance gain when we use MS SQL as back end.
And the performance gain is not negligible.
Regarding cost factor for original. Do not install it on your computer. Have one with web hosting account.
Install SSMSE(Its free) on you PC. Connect to remote server and do your job.
|
|
|
|
|
It's very tough to say which is better. I have a high traffic website which uses MySQL as backend and works like a charm. It gives good performance. But you can gain that only by optimizing your queries and code. Proper indexing also reduces the query execution time.
BTW, how are you connecting to MySQL from C#? Is it through Oledb? If yes, that might be the reason for bad performance. Oledb is slow and you should consider the MySQL connector provided by MySQL which can be downloaded from MySQL site. I'd suggest to go with MySQL (5.0 or later).
|
|
|
|
|
I am using MySql.Data.dll with c#, there is no OleDb.
In here if some one asks me what u recommend as back end with c#, i really get stacked, because now i have read different articles about both of them, in truth i do really appreciate to have trusted reference regarding benefits of each and disadvantage of each.
Abdul Rahaman Hamidy
Senior Student Student in Computer Science
Kabul, Afghanistan
Software Developer
|
|
|
|