Output parameters are returned in ObjectParameter instance. So you can use following code:
var result = new ObjectParameter("dbOutParamName", typeof(string));
var result = ctx.MyFunction("XYZ", result).ToList();
var data = result.Value.ToString();
If you feel it helps, Mark as answered so that it can help others to find solution.
--Dhanraj Patil
gopikrsna
Member
190 Points
234 Posts
EntityFrameWork MySql Routines Out Paramter?
Feb 15, 2012 08:50 AM|LINK
Hello Wolrd!
How to get out parameter of Mysql routines using EntityFramework.
Thanks in advance!
DhanrajPatil
Member
186 Points
45 Posts
Re: EntityFrameWork MySql Routines Out Paramter?
Feb 15, 2012 08:55 AM|LINK
Output parameters are returned in ObjectParameter instance. So you can use following code:
var result = new ObjectParameter("dbOutParamName", typeof(string)); var result = ctx.MyFunction("XYZ", result).ToList(); var data = result.Value.ToString();--Dhanraj Patil
gopikrsna
Member
190 Points
234 Posts
Re: EntityFrameWork MySql Routines Out Paramter?
Feb 15, 2012 09:50 AM|LINK
Your code works good for sqlserver.
But same code will not work of MySql.
I'm getting null as outparamter
Richey
Contributor
3816 Points
431 Posts
Re: EntityFrameWork MySql Routines Out Paramter?
Feb 21, 2012 09:51 AM|LINK
Hi,
You can refer to the below links. It has a complete sample in the below link about how to access MySql in .net.
http://www.codeproject.com/Articles/35662/Mysql-Data-Access-Layer
http://stackoverflow.com/questions/1235792/what-is-a-good-way-to-handle-returned-data-from-mysql-and-c