Questions tagged [sqlmetal]

The SqlMetal command-line tool generates code and mapping for the LINQ to SQL component of the .NET Framework.

The SqlMetal command-line tool generates code and mapping for the LINQ to SQL component of the .NET Framework.

93 questions
1
vote
1 answer

SqlMetal scripting and capitalization

When I run SqlMetal it generates all views and functions with a capital letter. Is their a way to make it generate it in whatever case is in the database? When I use the UI to build the DBML and CS file it handles this properly, however when I…
Kenny Mann
  • 881
  • 10
  • 28
1
vote
1 answer

sqlmetal.exe returns Using the generic type 'System.Data.Linq.Table' requires 1 type arguments

I am using sqlmetal.exr to generate the mapping code for me. I am calling sql metal by using. cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin SqlMetal.exe /server:servername\SQL /database:mydb /code:mycode.cs The output is a cs file and…
John
  • 487
  • 8
  • 16
1
vote
1 answer

SQLMetal: How to find Connection String?

I am trying to create a simple offline application for personal-use that uses a SQL Server Compact 3.5 database and I plan to use Linq-to-SQL to work with it. I have used SQLMetal (through the application SqlmetalBuilder) to create a dbml file, and…
Gaijinhunter
  • 14,587
  • 4
  • 51
  • 57
1
vote
0 answers

Using SQL Server CE and SQL Server Express

I have an app which currently uses SQL Server CE, and the schema is in a .sdf file. Now we want to allow it to connect to a SQL Server Express edition based on some mode. I have a couple of questions: Will the Linq-to-SQL files (generated by sql…
Abhilash L L
  • 366
  • 2
  • 7
  • 16
1
vote
1 answer

How to include an auto generated file in a MsBuild project?

Using MsBuild 4.0 I included a pre-build event that generates one of the project source files. But it seeks for the file before it is generated: error CS1504: Source file 'c:\src\Data\Main.Designer.cs' could not be opened ('Unspecified error…
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
1
vote
2 answers

sqlmetal.exe not found in path even though it is on my machine in the correct path - Linqer Program

I am trying to run Linqer (a program for sql -> linq) and getting this error when creating a DB connection, and trying to generate "linq to sql model files". Error: File C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2…
Liam
  • 429
  • 1
  • 13
  • 33
1
vote
1 answer

entity framework dynamic schema load

I'm working on a database schema that involves two static sales agency that have the same database model. For example: dbo.User becomes paris.User and toulouse.User Our project works with Linq To SQL and we use sqlmetal to generate two map files one…
1
vote
0 answers

Sql type provider ignores changes in .dbml file

I use the dbml like this: type S = DbmlFile<"db.dbml", ResolutionFolder = @"."> After I removed a column in one of the database tables and regenerated the dbml the requests to this table continued to contain the column. So, I was getting…
alehro
  • 2,198
  • 2
  • 25
  • 41
1
vote
2 answers

No parameterless constructor defined for this object

In my project, I create Linq-to-SQL classes using SqlMetal. The problem with this is that SqlMetal doesn't appear to create a parameterless constructor. I've always gotten around this because I can always get the default connectionstring name and…
higgsy
  • 1,991
  • 8
  • 30
  • 47
1
vote
1 answer

SQLMetal incompatible database error with SQL Server CE

I have created a simple SQL Server Compact database in my C# project. When I try to use SQLmetal with my database1.sdf file to create a code file, I am getting the following error message Error : Incompatible Database Version. If this was a…
1
vote
0 answers

SqlMetal cannot generate new foreign key associations to certain tables

My team are using SqlMetal to generate database classes from a SqlServer database. It works perfectly for all of our existing classes and foreign key associations but it's refusing to generate the code for a particular new foreign key association…
joelimus
  • 39
  • 8
1
vote
1 answer

Method of saving the row creation time which can be generated by SQLMetal

I'd like to save the creation time of a row, so I have created a datetime column and set it's Default Value to be Getdate(). But when I generate the dbml file from SQLMetal and re-create the database from it, the function is missing. I've added the…
J_men
  • 387
  • 1
  • 4
  • 14
1
vote
2 answers

Accessing members of the other half of a partial class

I'm just learning to work with partial classes in VB.NET and VS2008. Specifically, I'm trying to extend a LINQ to SQL class that was automatically created by SqlMetal. The automatically generated class looks like this: Partial Public Class…
Herb Caudill
  • 50,043
  • 39
  • 124
  • 173
1
vote
2 answers

All or None with SQLMetal?

I was looking to create a pre-build method for a web application using SQLMetal to bring any changes since the last build into my DBML file. Since we are just starting out with LINQ most of the large database is not in the DBML. Is there any way…
Tom
  • 50
  • 4
1
vote
2 answers

How to read a DBML file and map it into an object model in .NET?

I'm planning to write a code generator to generate UI (forms, grids, etc.). Since I'm using LINQ I'm planning to read a DBML file for metadata extraction purposes. Is there some API to read the DBML object model (database, tables, columns, and…