I am trying to execute pro in SQL Server from LINQ in asp.net. It works fine when I execute Proc in SQL, but when I try to call it from linq in asp.net, it gives the following error: "System.Void" is not a valid return type for the associated stored procedure method "Here is my good,
ALTER PROCEDURE [dbo].[VIEW_COLUMN] @REPORT_NO INT , @TEMPLATE_NAME VARCHAR(100), @BODY_TEXT VARCHAR(500), @BODY_TEXT_O VARCHAR(500) OUTPUT AS BEGIN
On my ASP.net page
using (EHSIMSDataContext db = new EHSIMSDataContext(EHSIMSConnectionString.GetConnectionString())) { string MainString = _EmailTemp.TEMPLATE_TEXT; int? R = 000001; string b = ""; string temname = _EmailTemp.VIEW_NAME; db.VIEW_COLUMN(R, temname, MainString, ref b); }
After the error, I googled and changed my designer page to, (deleted void and added a line and added the last return line)
public string VIEW_COLUMN ------etc { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), rEPORT_NO, tEMPLATE_NAME, bODY_TEXT, bODY_TEXT_O); bODY_TEXT_O = ((string)(result.GetParameterValue(3))); return ((string)(result.ReturnValue)); }
And there is no return in the above code, as well as as the โPublic Void VIEW_COLUMNโ method, it still showed some other error, and I also tried to set the string as the return type in the DBML file of the properties of my procedures is still useless, I donโt know what lacks.
Additional Information Do I have a Temp variable and a table in my procedure, maybe the reason?
Some answers will be really helpful ... Thanks