Happens what? Errors? It happens when I compile the solution. Like I said I had to remove a SP and add it back. Why then there are so many errors with other SP/Functions??? They WERE working. How come all of a sadden they have problems? That I will never
understand.
There is one microscopic detail - ..... it just worked, one second ago .... worked. How, that can be after removing a SP, adding it back, and compiling the whole solution is broken?? All functions are reported having problems.
It has nothing to do with the SP I tried to remove and add. Something had happened after I compiled my solution.
Here is a list of errors:
Error 1 The best overloaded method match for 'System.Data.Entity.Core.Objects.ObjectContext.CreateQuery<Sunriseclub.Models.udf_getEmail_Result>(string, params System.Data.Entity.Core.Objects.ObjectParameter[])' has some invalid arguments C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs
49 20 Sunriseclub
Error 2 Argument 2: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 49 150 Sunriseclub
Error 3 Argument 3: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 49 163 Sunriseclub
Error 4 The best overloaded method match for 'System.Data.Entity.Core.Objects.ObjectContext.CreateQuery<Sunriseclub.Models.udf_getProduct_Result>(string, params System.Data.Entity.Core.Objects.ObjectParameter[])' has some invalid arguments C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs
59 20 Sunriseclub
Error 5 Argument 2: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter[]' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 59 146 Sunriseclub
Error 6 The best overloaded method match for 'System.Data.Entity.Core.Objects.ObjectContext.CreateQuery<Sunriseclub.Models.udf_getOrderHistory_Result>(string, params System.Data.Entity.Core.Objects.ObjectParameter[])' has some invalid arguments C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs
69 20 Sunriseclub
Error 7 Argument 2: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter[]' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 69 164 Sunriseclub
Error 8 The best overloaded method match for 'System.Data.Entity.Core.Objects.ObjectContext.CreateQuery<Sunriseclub.Models.udf_getOrderDetail_Result>(string, params System.Data.Entity.Core.Objects.ObjectParameter[])' has some invalid arguments C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs
79 20 Sunriseclub
Error 9 Argument 2: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter[]' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 79 160 Sunriseclub
You tell me what to show, because it's not about code I have written, but about auto generated one. So, tell me what to show, because I have absolutely no clue and dont want to know what VS generates on background.
asp.netforum...
Member
604 Points
132 Posts
Re: Tell me if I am doing it wrong
Jan 24, 2013 03:43 PM|LINK
hai
Its one sample SP in datamodel.
[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.FilterAddressResults")]
public ISingleResult<FilterAddressResultsResult> FilterAddressResults([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Float")] System.Nullable<double> maxLat, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Float")] System.Nullable<double> maxLong, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Float")] System.Nullable<double> minLat, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Float")] System.Nullable<double> minLong, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NVarChar(200)")] string locationId, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Bit")] System.Nullable<bool> needResume, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Int")] System.Nullable<int> numResults, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Float")] System.Nullable<double> salaryFrom, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Float")] System.Nullable<double> salaryTo, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NVarChar(100)")] string keyword, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Float")] System.Nullable<double> distance)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), maxLat, maxLong, minLat, minLong, locationId, needResume, numResults, salaryFrom, salaryTo, keyword, distance);
return ((ISingleResult<FilterAddressResultsResult>)(result.ReturnValue));
}
Please check your datamodel sp parameters in your datamodel
samegoldinBu...
Member
141 Points
161 Posts
Re: Tell me if I am doing it wrong
Jan 24, 2013 03:48 PM|LINK
Sorry, I am not getting it.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Tell me if I am doing it wrong
Jan 25, 2013 12:04 AM|LINK
Does it happen when importing SPs into EntityFramework's file?
samegoldinBu...
Member
141 Points
161 Posts
Re: Tell me if I am doing it wrong
Jan 25, 2013 02:34 PM|LINK
Happens what? Errors? It happens when I compile the solution. Like I said I had to remove a SP and add it back. Why then there are so many errors with other SP/Functions??? They WERE working. How come all of a sadden they have problems? That I will never understand.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Tell me if I am doing it wrong
Jan 26, 2013 12:54 AM|LINK
Hi,
I mean that can you show us your step-by-step image screens of importing SP into EF?
And then when you press F5 to debug your app, Is there anything wrong throwing out the exceptions?
sachinp290
Member
88 Points
21 Posts
Re: Tell me if I am doing it wrong
Jan 27, 2013 08:06 AM|LINK
you need to create navigation entitties for foreign key objects.
for this just create virtual properties for foreign key objects.
samegoldinBu...
Member
141 Points
161 Posts
Re: Tell me if I am doing it wrong
Jan 27, 2013 04:35 PM|LINK
There is one microscopic detail - ..... it just worked, one second ago .... worked. How, that can be after removing a SP, adding it back, and compiling the whole solution is broken?? All functions are reported having problems.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Tell me if I am doing it wrong
Jan 28, 2013 12:29 AM|LINK
Hi,
Without showing your SP and your screenshots but only a generic information, I'm afraid I cannot understand what you mean.
samegoldinBu...
Member
141 Points
161 Posts
Re: Tell me if I am doing it wrong
Jan 28, 2013 03:25 PM|LINK
It has nothing to do with the SP I tried to remove and add. Something had happened after I compiled my solution.
Here is a list of errors:
Error 1 The best overloaded method match for 'System.Data.Entity.Core.Objects.ObjectContext.CreateQuery<Sunriseclub.Models.udf_getEmail_Result>(string, params System.Data.Entity.Core.Objects.ObjectParameter[])' has some invalid arguments C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 49 20 Sunriseclub
Error 2 Argument 2: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 49 150 Sunriseclub
Error 3 Argument 3: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 49 163 Sunriseclub
Error 4 The best overloaded method match for 'System.Data.Entity.Core.Objects.ObjectContext.CreateQuery<Sunriseclub.Models.udf_getProduct_Result>(string, params System.Data.Entity.Core.Objects.ObjectParameter[])' has some invalid arguments C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 59 20 Sunriseclub
Error 5 Argument 2: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter[]' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 59 146 Sunriseclub
Error 6 The best overloaded method match for 'System.Data.Entity.Core.Objects.ObjectContext.CreateQuery<Sunriseclub.Models.udf_getOrderHistory_Result>(string, params System.Data.Entity.Core.Objects.ObjectParameter[])' has some invalid arguments C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 69 20 Sunriseclub
Error 7 Argument 2: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter[]' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 69 164 Sunriseclub
Error 8 The best overloaded method match for 'System.Data.Entity.Core.Objects.ObjectContext.CreateQuery<Sunriseclub.Models.udf_getOrderDetail_Result>(string, params System.Data.Entity.Core.Objects.ObjectParameter[])' has some invalid arguments C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 79 20 Sunriseclub
Error 9 Argument 2: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter[]' C:\qasource\Sunriseclub\Sunriseclub\Models\SunriseclubModel.Context.cs 79 160 Sunriseclub
You tell me what to show, because it's not about code I have written, but about auto generated one. So, tell me what to show, because I have absolutely no clue and dont want to know what VS generates on background.
Thank you.
samegoldinBu...
Member
141 Points
161 Posts
Re: Tell me if I am doing it wrong
Jan 28, 2013 06:01 PM|LINK
Here is what it was:
using System.Data.Objects;
replaced with:
using System.Data.Entity.Core.Objects;
in SunriseclubModel.Context.cs.
and everything worked. Philosically speaking, not a big deal.