|
My product is targeted to a Portuguese audience where the comma is the decimal symbol. I usually use CString::Format to input numbers into strings, and it takes into account the computer's regional settings. While in general this is a good approach, I...
Started by djeidot on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
(MFC and SQL has been a while - turns out this is bloody ... .
It's not really trivial to do SQL injection with just numbers, but CString::Format is just not the correct way to do parameter binding .
Bad idea, you really should be using prepared statements.
|
|
I want to sort list of strings with respect to user language preference. I have a multilanguage Python webapp and what is the correct way to sort strings such way?
I know I can set up locale, like this:
import locale locale.setlocale(locale.LC_ALL, ''...
Started by Jiri on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
IMO it should be better....
Given the documentation warnings, it seems you are on your own if you try to set locale diffrently set of bindings to it!
You will want the latest possible ICU under your pyICU to get the best them with ORDER BY.
|
|
I deployed my asp.net web app project that has a reference to my DAL class library. How can I change the connection string in my DAL library once deployed? The DAL code was ignoring my web.config connection string and trying to use the app.config value...
Started by Breadtruck on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
By specifying that the application should include a connection-string named "FOO", or (much better) allowing the calling application to pass (one of) the connection key, the connection string objects I make a call to the web.config file....
|
Ask your Facebook Friends
|
Why does (string)int32 always throw: Cannot convert type 'int' to 'string'
public class Foo { private int FooID; public Foo() { FooID = 4; string s = (string)FooID; //throws compile error string sss = FooID.ToString(); //no compile error } }
Started by tanbuckeye on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Maybe to convert int to string, the ....
However, they have Int32.ToString();.
Int doesn't have an explicit operator to string.
That's what the ToString method is for.
Because there is no type conversion defined from Int32 to string.
|
|
I've written a class that should allow me to easily read and write values in app settings:
public static class SettingsManager { public static string ComplexValidationsString { get { return (string)Properties.Settings.Default["ComplexValidations"]; } ...
Started by agnieszka on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
I know....
settings scope must be user not application
Are you sure it's not saving the changes:\Documents and Settings\[user]\Local Settings\Application Data\[company name]\[application].exe[hash string]\[version]\user.config .
|
|
I am trying to convert a LPCSTR string into LPCTSTR string. i want to concatenate two string,when i try like this
LPCTSTR str1 = L"Raja" LPCSTR str2 = "Kumar" wcscat_s(str1,(LPCTSTR)str2);
i found the o/p like Raja....r(junkvalues)....how can typecast...
Started by Rajakumar on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You need to convert one to be a wide string, you'd need....
Further, you cannot possibly concatenate a wide string and a plain char string.
LPCTSTR can be either plain char or wide characters depending on your project settings.
|
|
When I try:
LinkedList<String> stringList = new LinkedList<String>();
I get the following compilation error:
type LinkedList does not take parameters
What am I missing? Can't you do this?
Started by FarmBoy on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Language settings set to Java 5+ and that is a java.util.LinkedList then your code is perfectly in your build or IDE set to pre-5.0 (so no generics support)?
By the way, the best way to do.
|
|
I'm trying to save a string variable from my FolderBrowserDialog.SelectedPath().
Using a breakpoint I can see that the string is correctly loaded onto SelectedPath(), but I can't save that string to the .settings file for the life of me. Any help?
public...
Started by John McClane on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Properties.Settings.Default.Save();
Check out Using Settings in C# ..
|
|
Please, help me to identify problem in my C# code(WPF, event-handler):
private void Discount5Btn_Click(object sender, RoutedEventArgs e) { decimal catPr; decimal salePr; string catPrStr; catPrStr = PriceCatTBox.Text; catPr = decimal.Parse(catPrStr); salePr...
Started by rem on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
And am I right in such an approach....
Decimal.TryParse to process.
We can't help you because we don't know the value of catPrStr , you are converting from String to Decimal and most likely the value of the string being converted is incorrect.
|
|
I got strange error message when tried to save first_name, last_name to Django's auth_user model.
Failed examples
user = User.object.create_user(username, email, password) user.first_name = u'Rytis' user.last_name = u'Slatkevičius' user.save() >>...
Started by jack on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Make them actual unicode string literals:
user.last_name = u'Slatkevičius'
or (when you don't have string literals) decode them using the utf-8 encoding:
user.last_name = lastname.decode('utf-8.
|