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
|
Heya,
I've setup a MySQL database containing a single table using the following definition :
CREATE DATABASE `tests` /*!40100 DEFAULT CHARACTER SET utf8 */;
DROP TABLE IF EXISTS `tests`.`users`; CREATE TABLE `icode.tests`.`users` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, `Name` varchar(15) NOT NULL, `Password` varchar(15) NOT NULL, `Email` varchar(45) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
I've created a console application + a class library containing the LightSpeed model of the particular database. I've made some adds/removes from C# code and it worked flawlessly - as expected. I've then decided to have a go @ LinqPad using LightSpeed, so after a little bit of exploring I've added a new LightSpeed connection. DataProvider = MySQL5 ConnectionString = my connection string Pluralize table names[checked] Identity method = Identity Column Timestamp method = local I've then pressed the "Infer from model" btn, and selected my LightSpeed model. Pressed "ok" - a connection appeared - huzzah. In the main view, I've selected my new connection int he Database combo-box. I've then selected "C# Statement" and input a : Users.Count(); statement - got a small yellow popup saying : '', hexadecimal value 0x07, is an invalid character. I've changed the statement to : var users = Users.Select(u => u); - got the same popup. Changed the C# Statement to C# Expression, r-clicked the table in the connections treeview and input the following expression : from u in Users select u - same popup.... x( It's pretty frustrating as I have no idea if have done something wrong. I'd apreciate some help. |
|
|
I too have encountered the following error: I contacted Joe Albahari at LinqPad and he suggested that it was a known issue and the Mindscapes folks were working on it and might have a fix. Thank you for your assistance. Kenneth James |
|
|
I too have encountered the following error:
' ', hexadecimal value 0x08, is an invalid character. [that character seems to blow up this message as well] I have not used LinqPad in several months now, but just upgraded to MS Visual Studio 2010 (with .Net 4.0 that came with it), downloaded the latest LinqPad4 release, and the Mindscape nightly build of a few days ago. I connected a Mindscape Lightspeed Model that was built in MS Visual Studio 2010 to LinqPad 4.26 using the supplied Mindscape data connection 3.0.0.13259. When I tried a simple query (People.Take (50), the above mentioned error is posted in a yellow line above the query editor. I initially contacted Joe Albahari at LinqPad but he suggested that this is a known issue and that you folks at Mindscape might have a fix for this.
Thank you for your assistance. Kenneth James
|
|
|
Hello Kenneth, This looks like an obfuscator issue and I have been trying to reproduce it here but the queries are working okay for me. Could you provide us with a copy of the Person class, and also let us know which database you are using? (I have tried both SQL Server and MySQL and it is working for me with both.) Are you able to successfully query the People property in your own application (i.e. from your own C# or VB code rather than in LINQPad) or does that result in a similar error? Are you using Mono? (I don't know if this is even possible with LINQPad, but we do know of a conflict between our obfuscator and the current version of Mono.) Is your LINQPad language C# or Visual Basic? Do all the settings in the Connection Properties dialog look correct? Is there anything in the %AppData%\Local\LINQPad\Logs directory? That could give us more information about where the error is actually occurring. Thanks! |
|
|
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} Thank you for your prompt reply. I keep forgetting you folks are a day ahead of me! LOL
I have sent to support appropriate files that might help.
I am using MySql5 as the database.
I don't have any linq queries as such in my project yet, but I can populate all of the grids and controls without difficulty, and perform all of the CRUD functions.
I am using C# in both MS Visual Studio and in LinqPad4. The connection settings look fine to me. The app config file is included in the zip.
I don't believe I am using Mono, I am not familiar with that.
I don't spot any obvious thing in the LinqPad log files, but there is one .DAT file that I can't open that might have important information.
When working in LinqPad, I can query the crud_demo database within MySql directly, without using the Mindscape Model. Unfortunately, this method of access doesn't update the keytable appropriately to assign new keys.
Thank you for your assistance.
Kenneth James |
|
|
Hi, I had a similar problem the other day and sorry if I'm off topic, cant hurt to throw in my 2 cents on how I found and resolved it. Note: I've not tried LightSpeed with Linq yet but meh: |
|
|
Hello Kenneth, I've re-tried with your model and still can't reproduce the problem. As per Jeremy's suggestion, I wonder if this could be a data issue -- however there's no XML processing in your model so I don't see where such an issue could be coming from. One thing you could try is issuing a query that returns no results (People.Where(p => p.NameFirst == "qiosfewfnj")) and see if you still get the error. If not then that may point to some sort of data issue. It may also be worth monitoring MySQL to see if LightSpeed gets as far as issuing the query. Further to Jeremy's comments, I guess it is faintly possible that there is something nasty lurking in a LINQPad configuration or settings file, but it's not obvious to me what or where that might be, and if that were the case I'd expect the error to happen before you ran the query. You could try temporarily "cleaning out" LINQPad by renaming the %AppData%\Roaming\LINQPad and ProgramData\LINQPad directories, recreating the connection and see if that helps. If none of this helps then I'll see if we can work with Joe to identify why there's nothing in the log file and see if we can get some additional logging put in. |
|
|
Kenneth, Another idea that occurred to me: attach the Visual Studio debugger to LINQPad and try to get a look at the exception before LINQPad swallows it. This will allow us to see where the exception is happening and to track it down if it's inside LightSpeed. Since LINQPad handles the exception, this will probably be viable only if the message tells you the type of the exception. If it doesn't, System.Xml.XmlException is still worth a try as per Jeremy's comment, or try monitoring *all* first-chance exceptions (though this can get a bit dreary). In case you haven't used this trick before, here's how to do it: - Start LINQPad. - Open Visual Studio 2010. You don't need to open a solution. - Choose Debug > Attach to Process, and choose the linqpad.exe process. - Go into Debug > Exceptions, locate the type of exception in the tree and tick the Thrown box. - In LINQPad, run the query that causes the error. You should see the Visual Studio exception assistant, probably against a page saying "No source code available" or something like that. Check that it's the right exception (going by the message). If it is, go into the exception assistant Details link, and grab the stack trace and post it for us to have a look at. If you guessed the wrong kind of exception, you may still be able to figure it out by looking in the Visual Studio Output window and seeing if a message goes by about a "first-chance exception." Tick the Debug > Exceptions > Thrown box for anything that looks suspicious and try again! Once we have the stack trace, we stand a much much better chance of tracking this issue down. No promises but we will do what we can! Thanks for your help! |
|
|
Aha! It's a MySQL versioning issue. If I install MySQL Connector 6.3.5 like you have, then I get the same error. Normally the workaround for this would be to put a binding redirect into LINQPad.exe.config. But for some reason LINQPad seems to ignore that and continue searching for 6.2.3 (even though the exact same config file redirects successfully in a 'normal' application). I'll ping Joe and see if he has any suggestions. (And draw his attention to the misleading error message!) In the meantime, the only suggestion I have is to revert to 6.2.3. Not ideal, but hopefully we'll have a better fix for you soon. |
|
|
Ah, found a workaround that doesn't require reverting to 6.2.3 -- install the 6.2.3 DLL in the GAC (just the DLL, not a full install of 6.2.3 which would require uninstalling 6.3.5). To do this: - Copy MySql.Data.dll and Mono.Security.dll from the LightSpeed Providers/MySql5 directory to the LINQPad directory. - Open a Visual Studio command prompt and navigate to the LINQPad directory. - Enter the command gacutil /i MySql.Data.dll Restart LINQPad and with a bit of luck all will now work! |
|
|
Viola! Thank you Ivan for your swift help in finding the quick fix in this MySQL versioning issue. I redid the instructions you sent me on how to move and install the MySql.Data.dll and Mono.Security.dll from the LightSpeed Providers/MySql folder to the LINQPad folder. After correcting the path error I had made in the Visual Studio 2010 Command Prompt, my test project works perfectly in LinqPad.
I am very grateful. Thank you so much. Kenneth James |
|
|
Heard back from Joe and he has this suggestion on the binding redirect solution (not tested): you can create a file called LINQPad.config (rather than LINQPad.app.config) and LINQPad will pick this up and apply it to queries. I don't know whether the CLR allows binding redirects can be applied at this level - I've never tried it. So it may be worth giving it a go with a redirect in LINQPad.config. Or you may just want to leave well alone now it's working! |
|
|
woot! finally some progress |
|