Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8947631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:48:53+00:00 2026-06-15T12:48:53+00:00

When using the dbml autogeneration in visual studio, a stored procedure call typically ends

  • 0

When using the dbml autogeneration in visual studio, a stored procedure call typically ends up looking like this

    [global::System.Data.Linq.Mapping.FunctionAttribute(Name="MYDB.ui_index_group_upd")]
    public int ui_index_group_upd([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Int")] System.Nullable<int> group_id, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="VarChar(32)")] string group_code)
    {
        IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), group_id, group_code);
        return ((int)(result.ReturnValue));
    }

and this would be typically called like so….

  using (var db = new L2SDataContext(base._connectionString))
  {
    var result = db.ui_index_group_upd(1, "foo");
  }

This is all fine.

However what i’m trying to achieve is a global way of error trapping and reporting all such method calls in such a way as to record name of proc, and values for all parameters passed in the event of a problem

I’d rather not write specific code proc code for each method and definately don’t want to modify autogen code for obvious reasons.

I’m thinking a layer between my call and the dbml method but i though that perhaps someone has encountered a similar issue so I thought I’d put it out there before I spend the day messing about till i get a reasonable answer. I think the trick is a graceful way of enumerating the parms and proc name etc etc

I hope this makes sense, all feedback appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:48:54+00:00Added an answer on June 15, 2026 at 12:48 pm

    I think that replacing MSLinqToSqlGenerator with something else is the cleanest solution and it might be done in several ways. You could, for example,

    1. Use a tool like T4 Toolbox: LINQ to SQL classes generator or Reegenerator and modify the provided template to suit your needs. That’s probably the easiest way.

    2. Generate the code with T4 using a custom template. You will need to create a T4 template which would use XML data from .DBML file. You’d probably need to disable DBML code generation by setting the Custom Tool property to blank. The disadvantage is you will need to run T4 generation each time after modifying .DBML file.

    3. Create a custom tool to generate the code for you using XML data from .DBML file and some templating solution (T4 or XSLT, perhaps). This approach could arguably be the most flexible one, the only disadvantage is that you’ll have to use the custom tool on every developers’ machine.

    I’m not sure what’s optimal for your situation, but I’d probably consider using T4 Toolbox first. The T4 template it uses is quite standard and can easily be modified if necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using visual studio 2008 and I've created a stored procedure that selects back
I created a database and dbml in visual studio 2010 using its wizards. Everything
I'm using Visual Studio 2008 Each time I modify my dbml through the designer
I am using Visual Studio 2010, and I have a LINQ-to-SQL DBML file that
i am using stored procedure and if i add/remove parameters (in the sproc) than
I am using visual studio 2008 and SQl Server 2008. I recently formatted my
Using Linq to SQL and the autogeneration capabilities of DBML, foreign key relationships create
I'm using linq2sql against an old database system. In this system there are three
Is there a way to use the SQL Model (dbml) builder in VS2010 using
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.