The user selects a horsename from combo which updates textbox1.
i have the following array which is in php and will like to convert to fit visual.
$ar = array('A' => 1,
'B' => 2,
'C' => 3,
'D' => 4,
'E' => 5);
when the user selects a horsename "DAB" WHICH updates textbox1. i want the form to work out that "DAB" is "4+1+2=7" and show in textbox3 as 7
please help as i have downloaded vs.php and phalenger3 but i am still stuck as i cannot activate it with my hkey.
13 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Dec 14, 2012, 2:57 PM
VulpesPosted Dec 16, 2012, 12:08 PM
adapter.Update(dtB);
shabeer shaikPosted Dec 16, 2012, 6:26 AM
}
dr["HNUM"] = total.ToString();
}
dg1 DataSource = dtResults;
im sure the update comes somewhere here.
VulpesPosted Dec 15, 2012, 7:02 AM
Try it like this:
VulpesPosted Dec 13, 2012, 3:01 PM
shabeer shaikPosted Dec 13, 2012, 2:34 PM
At the moment this is fine where the member has to select to get a total. i want it to take the form load and do a grid.
If u dont mind me taking advantage.
VulpesPosted Dec 13, 2012, 2:23 PM
If you have, then ToUpper() should be ToLower().
shabeer shaikPosted Dec 13, 2012, 2:08 PM
VulpesPosted Dec 13, 2012, 1:53 PM
I've made a change to deal with that and also to make sure that there no problems with lower case letters as well:
shabeer shaikPosted Dec 13, 2012, 12:14 PM
he given key was not present in the dictionary. Is this because of the space between the two words. Otherwise it works fine with just single words.
i tried the trim(). it does not work. if i can probally join the two words in a hidden box it might work.
please help with that
VulpesPosted Dec 12, 2012, 5:31 PM
Yes, you can load the combobox from a SQL database rather than adding the items manually.
As you say there doesn't seem any need for the first textbox.
The changes to the code will be as follows:
If you check this thread, there's some code which shows how you can load the combobox from a SQL Server database:
http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/4c346770-0319-4d74-b3a9-879152398579
shabeer shaikPosted Dec 12, 2012, 4:39 PM
i have tried this and it works. There is two problems.
first i gave an example of array. the true array has numbers recurring
A=1; B=2;C=3;D=4;E=1;F=2;G=4;H=4ETC ALL the way to z.
second : my combobox has a list of 150 names to choose from. it changes every 2nd day.
can i not call it from sql database. otherwise i have to manually input.
honestly i dont see the need for textbox1 as we can use the combox and result to textbox2.
thank you if you can help with that
VulpesPosted Dec 12, 2012, 3:36 PM
Note that since array indexing starts at 0 in C# you have to add 1 to get the value of the corresponding character: