c# - How to corretly load DataContext of Conditional Linq-to-SQL Stored Proc -


I have a stored prompt that verifies a parameter

ex.

IF @SearchType = 'BNA' BEGIN ... Start some time ago if you type @ search = 'SNA' ... something done END < P> By default, the stored Proc returns a scalar value and if SearchType = anything is valid then it will return an IMultipleValues.

The problem is that when I leave my store prompt in Datacentext Designer, it creates LINQ-to-SQL for a function that does not understand that only one scalar returns int That Strold Process can return an IMultipleResults with a scalar value and a dataset.

Does anybody know how to extrapolate the possible return values ​​of LINQ-to-SQL?

I can not directly answer your question, but did you use SQL Profiler Have tried to retrieve the designer metadata of your stored procedure?

I'm thinking that in your situation, the designer might not be able to find things out for the SQL profiler to help you to find out in this way ...

I have had very positive experience with using SQLMattle (instead of designer). The documentation for saving you is on googling.

SqlMetal can be used in one way:

  1. Run a SqlMetal to remove the database metadata for a DBML file.
  2. Run some custom processing on the DBML file (which is easy to do because it's just XML).
  3. Run SQLMail to resume updated DBML in code.

Using this approach, you can correct the metadata being used for your stored procedure (

Winning about this approach to me The thing is that whenever you need you can modify your database, and you can easily type the matching account, while still keeping high level control is generated.


Comments