Mysql stored procedures in Entity Framework error

Grazehell

2[H]4U
Joined
Jun 13, 2001
Messages
2,660
I seem to be having problems importing stored procedure in entity framework for child tables.
As verbose as this error may seem I have no idea how to fix it besides maybe deleting the relationship then importing the stored procedures, then add back the relationships after(not a good idea).
I turned off the cascades delete and update but its still a no go.

This is my error.

sRf0GvR.png

The tables
GSacSZn.jpg


Code:
delimiter $$

CREATE DEFINER=`root`@`%` PROCEDURE `sp_AddPool`(
IN rid INTEGER,
IN pid VARCHARACTER(50),
IN pnam VARCHARACTER (50),
IN wmin DECIMAL, 
IN wmax DECIMAL)
BEGIN
INSERT INTO pool (raceid,poolid,
poolname,wagermin,
wagermax) 
VALUES (rid, pid, 
pnam, wmin, wmax);
SELECT LAST_INSERT_ID();
END$$

I am using VS2012
 
The problem seems to be linked to the fact that entity framework when importing stored procedures test them by adding all zeros for the fields in the child table including that of the foreign key field(raceid).
The things is that since there was no id field(which is auto incremented) in the parent table with zero, being that the first record with id zero was long deleted, entity framework threw an error.

Ugh, I wonder if I have to option of not testing with dummy data when adding stored procedures in this thing. I got a work though by changing an id field in the race to zero.
 
a little off topic, but how are things working out using .net and MySql? This would seem to be a nice cheap way to run .net websites.
 
Well this is a project I came into as a contract programmer so I have only been using the two for about a week.
My client has been using the combination to process track betting so I would guess it works quite well. I was a little bit surprised to hear they were using Mysl with VB.net though.

My plan is to get them up using entity framework in C#. Using Mysql connector I cannot tell the different between Mysql and T-Sql so far. Everything integrates just fine.

I will let you know if we have an epic fail anywhere. I don't anticipate there will be though.
 
a little off topic, but how are things working out using .net and MySql? This would seem to be a nice cheap way to run .net websites.

My wife's company does this and it sounds like this really limits their choices of web hosting companies. She always complains that the one they deal with is shitty. So if you are working with a company to host your site, it is probably more common to have Linux, Apache, MySQL, PHP (LAMP stack) or Windows Server, IIS, SQL Server, .NET or Linux, Apache/Tomcat, Oracle, Java etc.

Disclaimer : I've not worked in web development.. but I would at least investigate this if I were considering such a thing Granted it should be possible
 
Back
Top