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

  • Home
  • SEARCH
  • 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 1003899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:02:59+00:00 2026-05-16T08:02:59+00:00

When dbml file is generated automatically by Visual Studio I get the exact field

  • 0

When dbml file is generated automatically by Visual Studio I get the exact field names as they appeared in the tables.

However, since VS does not provide refresh function for dbml, I run sqlmetal manually to re-create dbml file. It works fine with one exception — sqlmetal "corrects" the names

ses_Id -> Ses_Id
aga_Id -> Aga_Id

and so on — it probably changes camelCase to CamelCase.

Sqlmetal help does not list any switch to keep field names as-is (there is only pluralize switch). So, does anyone know the hidden switch to keep the case of field name?

Thank you in advance.

SOLVED

There is no such switch, and MS was notified about the problem — the wish report to add such feature (because it casuses problem with updating project) was closed as wontfix 🙁

  • 1 1 Answer
  • 1 View
  • 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-05-16T08:02:59+00:00Added an answer on May 16, 2026 at 8:02 am

    I doubt there is a hidden switch. I had the same problem, so I wrote a simple Perl script to sort it out:

    # Usage: fdbml.pl in.dbml out.dbml
    my $in_file = $ARGV[0];
    my $out_file = $ARGV[1];
    
    # Scrape in file for identifiers
    my @identifiers;
    open IN, "<$in_file";
    while (<IN>) {
        if ($_ =~ /<Table Name="(?:\w+\.)?(\w+)" Member="(\w+)"/) { push @identifiers, "$1 $2"; }
        if ($_ =~ /<Function Name="(?:\w+\.)?(\w+)" Method="(\w+)"/) { push @identifiers, "$1 $2"; }
    }
    close IN;
    
    # Translate in file to out file
    open IN, "<$in_file";
    open OUT, ">$out_file";
    while (<IN>) {
        my $line = $_;
    
        # Replace identifiers
        foreach my $identifier (@identifiers) { 
            my ($new, $old) = split(' ', $identifier);
            $line =~ s/"$old((?:Result)?)"/"$new$1"/g;
        }   
        $line =~ s/<Parameter Name="(\w+)" Parameter="\w+"/<Parameter Name="$1" Parameter="$1"/;
    
        print OUT $line;
    }
    close OUT;
    close IN;
    

    Just save all that to fdbml.pl, make sure you have ActiveState Perl installed, then run this on your DBML file:

    fdbml.pl old.dbml new.dbml
    

    Ben

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

Sidebar

Related Questions

I have a rather large DBML file and recently discovered that Visual Studio's MSLinqToSQLGenerator
Visual Studio 2010 show dbml file of linq to sql mapping as a class
I am using Visual Studio 2010, and I have a LINQ-to-SQL DBML file that
I have a .dbml file which of course contains the auto-generated classes based on
I have two tables in a LINQ to SQL dbml file. I am trying
I have DataContext classes generated from dbml. Once I get data from the database,
I have created a smalldatetime field. I am using a dbml file to access
I created a dbml file, which automatically created the designer.cs In the designer.cs (which
How do I update a Linq to SQL .dbml file?
I need to put some of the entities created via a.dbml Linq-To-Sql file into

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.