[IronPython] Doing Simple Math In Silverlight

Jimmy Schementi Jimmy.Schementi at microsoft.com
Fri May 15 01:01:06 CEST 2009


Not directly, you can use Silverlight to connect to a web service which uses a database.

db40 got my attention a while ago for somehow hearing that it worked in SL, and stores everything in IsolatedStorage, but I never investigated it.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Andrew Evans
Sent: Thursday, May 14, 2009 3:59 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Doing Simple Math In Silverlight

Just a quick question also

is it possible to connect to a mysql database through silverlight and Iron Python

And if so anyone have an example


*cheers
On Thu, May 14, 2009 at 3:34 PM, Andrew Evans <andrew.canit at gmail.com<mailto:andrew.canit at gmail.com>> wrote:
Hey guys thank you

and thanks Michael will look into whitespace and error handling :-)

just wanted it to work :-P



On Thu, May 14, 2009 at 3:21 PM, Michael Foord <fuzzyman at voidspace.org.uk<mailto:fuzzyman at voidspace.org.uk>> wrote:
Andrew Evans wrote:
Hello

I am trying to perform some math operations in Silverlight

inputNum1 and inputNum2 are of TextBox

inputNum1 = TextBox()
inputNum2 = TextBox()

   result0 = int(inputNum1) + int(inputNum2)
That's because you can't cast text boxes to integers!

You need something like:


  result0 = int(inputNum1.Text) + int(inputNum2.Text)
You'll probably want to strip whitespace and also handle the error case where what the user has entered is not a valid integer.

HTH

Michael
   res0.Text = str(result0)

I get the following error
<http://go.microsoft.com/fwlink/?LinkID=124807> TypeError: expected int, got TextBox

Any ideas
------------------------------------------------------------------------

_______________________________________________
Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog


_______________________________________________
Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090514/40a18a3b/attachment.html>


More information about the Ironpython-users mailing list