Insert record into mysql db with Entity Framework
Posted
by sanfra1983
on Stack Overflow
See other posts from Stack Overflow
or by sanfra1983
Published on 2010-04-19T11:15:41Z
Indexed on
2010/04/19
12:53 UTC
Read the original article
Hit count: 231
Hi, the problem is that it will insert a new record in a mysql table, I have already done the mapping of the mysql db and I have already done tests returning data and everything works. Now I read from a file, where there are queries written, I have them run me back and the result of true or false based on the final outcome of single query written to the file. Txt; I did this:
using (var w = new demotestEntities ())
(
foreach (var l listaqueri)
(
var p = we.CreateQuery <category> (l);
we.SaveChanges ();
result = true;
)
)
but it does not work, I sense that it returns no errors, but neither the result given written in the query. txt file is as follows:
INSERT INTO category (id, name) VALUES (null, 'test2')
anyone can help me?
© Stack Overflow or respective owner