|
|
|
how add i you to friendlylist?
|
|
|
|
|
I'm not sure what a friend list is in CP terms. If you post a question and I can help, I'll generally try to do so, so there's no need to have a friend list there.
|
|
|
|
|
okay thank you
|
|
|
|
|
+5 for the tip! This will be useful!
"Go forth into the source" - Neal Morse
|
|
|
|
|
Yes 
|
|
|
|
|
I have have a textbox with id that is connected (local database relation) to gridview and that save hyphen als this -1. I have not a string?
|
|
|
|
|
What is the datatype of the identity-field? Is it a BIGINT ?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Database is .sdf
Datatype is INT with Primary Key
|
|
|
|
|
Both pieces of information should have been valuable in the original question.
You don't assign a value to an identity-field. It should generate a value by itself. And a GUID will never fit into an INT. Removing the hyphen will not help.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Either change the type in the database so it can hold a GUID , or let the database generate an INT .
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
identity = identity.Replace("-", "");
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Where can i change your replace id?
|
|
|
|
|
Most major retail clothing outlets have changing rooms.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
This is work. How how can i dow that for under Column name / row?
modified 23-Feb-15 8:52am.
|
|
|
|
|
Thanks, this string work with click. Replace string dont work for datagridview, how dow i that for datagridview?
|
|
|
|
|
Hi coders
I am looking to convert alphabet entries in a char array into their corresponding place in the alphabet. E.g. A=1, B=2, C=3, and onward.
I have done some searching online but can't find a way of doing this for an array, just for individual values. I imagine it will require a foreach loop, but I can't figure out the correct terminology
If someone could help I would hugely appreciate it 
|
|
|
|
|
Well on the assumption that your string is ASCII encoded, and with the knowledge that 'A' = 65 its simply a case of casting the character to an integer and taking off 64.
You could try something like this using linq:
var input= "ABC";
var output = input.Select(x => ((int)x)-64).ToArray();
or, more clearly:
int[] output = new int[input.Length];
for (int i = 0; i < input.Length; i++) output[i] = ((int)input[i]) - 64;
Regards,
Rob Philpott.
|
|
|
|
|
That's done it, thanks for the help Rob
|
|
|
|
|
Rob Philpott wrote: var output = input.Select(x => ((int)x)-64).ToArray();
Or, more clearly:
int[] output = input.Select(x => (x - 'A') + 1).ToArray();
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm being stalked! Well presuming subtraction of chars yields an int I guess that's a neater answer.
Personally, I'd probably stick with my answer though due to the explicit cast. And I should state I'd never do anything as filthy as using 'var' in my own code!
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: I'd never do anything as filthy as using 'var' in my own code!
I thought I was the only one who hated that filthy habit 
|
|
|
|
|
Tetra1044 wrote: a char array
An actual array of characters? Or a string? (Not that it matters much.)
Tetra1044 wrote: a foreach loop
for loops tend to be quicker than foreach loops, so use for whenever you can.
|
|
|
|