This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, i have a MySQL-Testdatabase. a simple Table (Meinetabelle), and i have with the Lightspeed-Designer a MySQLTestUnitOfWork-class created (in Namespace MeinTest). And this is my first testcode: Dim LittleTest As New MeinTest.MySQLTestUnitOfWorkDim Datas = From a In LittleTest.Meinetabelles For Each RS In Datas Label1.Text = RS.Strasse Next But my VisualStudio throws a NullReferenceExpetion in For Each RS In Datas. I hope you can help me Thanks |
|
|
Hi Andy, I think the problem is that you are creating a MySQLTestUnitOfWork directly. You need to get the LightSpeedContext to create the unit of work for you: Dim context As New LightSpeedContext(Of MeinTest.MySQLTestUnitOfWork) (There may be some syntax errors in here -- sorry, my Visual Basic is a bit rusty -- but hopefully you get the idea.) Note that usually you would not create a new LightSpeedContext every time -- you would set this up as a static (Shared) instance in app initialisation or Global.asax or somewhere, and/or load it from config. Hope this helps! |
|