Tom Knowlton
asked on
update linq mapping?
I made a change to a stored proc, and now this code is complaining:
Procedure or function 'AgentFormList_Get' expects parameter '@ClientID', which was not supplied.
The error is valid, there are a few more parameters to supply after I updated the stored proc. Do I edit this DataContext form code manually? It looks like it was computer generated.
I've not done much with LINQ.
How do I get everything updated so that LINQ uses the updated stored procedure, etc?
Procedure or function 'AgentFormList_Get' expects parameter '@ClientID', which was not supplied.
The error is valid, there are a few more parameters to supply after I updated the stored proc. Do I edit this DataContext form code manually? It looks like it was computer generated.
[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.AgentFormList_Get")]
public ISingleResult<AgentFormList_GetResult> AgentFormList_Get([global::System.Data.Linq.Mapping.ParameterAttribute(Name="AssetID", DbType="Int")] System.Nullable<int> assetID, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="AssetSID", DbType="Int")] System.Nullable<int> assetSID)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), assetID, assetSID);
return ((ISingleResult<AgentFormList_GetResult>)(result.ReturnValue));
}
I've not done much with LINQ.
How do I get everything updated so that LINQ uses the updated stored procedure, etc?
ASKER
I have the same directory path:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NET FX 4.0 Tools
How can I know for sure if the file was generated using SQLMetal or some other way?
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NET
How can I know for sure if the file was generated using SQLMetal or some other way?
ASKER
Is there a way to do this through the Visual Studio IDE (the GUI environement) instead of via the command line?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for this information.
I managed to get a hold of one of the other developers and asked him their process for updating LINQ / datacontext etc.
Here are the steps he gave me:
1) Double-click on the .dbml file
2) When it opens, delete the existing data class.
3) Open the Server Explorer
4) Find the modified Stored Proc
5) Drag it over to the list of data classes
This will update everthing so that if there are more (or fewer) params expected this will get updated everywhere.
I managed to get a hold of one of the other developers and asked him their process for updating LINQ / datacontext etc.
Here are the steps he gave me:
1) Double-click on the .dbml file
2) When it opens, delete the existing data class.
3) Open the Server Explorer
4) Find the modified Stored Proc
5) Drag it over to the list of data classes
This will update everthing so that if there are more (or fewer) params expected this will get updated everywhere.
You can use that tool to regenerate the stored procedure you've made some update by running the SQLMetal tool on the database.
To get you started, you can run this on the SQLMetal tool: (By the way, I found my SQLMetal.exe file in this location: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NET
Open in new window
Change the server, database, username & password accordingly.To give you an idea on how to use the SQLMetal tool, follow this: SQLMetal tool guide
Tell me how it goes.