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
0
votes
1 answer

LINQtoSQL: What is the Map File for?

I am currently using SqlMetal to generate my dbml and code file. I am using Visual Studio 2010 and SqlServer 2000. Unfortunately Visual Studio 2010 only support SqlServer 2005 or greater so I am unable to generate the code using the built-in…
user295190
0
votes
1 answer

LINQ to SQL: origins of EnumMapper.exe?

in this system I'm currently working on, the DataContext is being generated using SqlMetal via a process very similar to what's detailed here. Run SqlMetal.exe on database to generate a dbml file Run a console app on dbml file to replace specific…
adamjford
  • 7,478
  • 6
  • 29
  • 41
0
votes
1 answer

Incorrect syntax near the keyword 'WHERE' when updating table using SQLMetal generated class

I have a pretty basic table in SQL Server (dual key, no foreign keys). I have generated mapping code using SQLMetal. I have also extended the auto generated partial class so I can implement IEquatable. The problem is that once I implement…
c31983
  • 449
  • 4
  • 16
0
votes
1 answer

Can we use SQLMetal Objectmodel as application object model?

Our team has just started using Sql Metal and I have been playing around with it for 2 days. While doing this, I have noticed couple of things. When we run command like following sqlmetal /code:ps.cs /server:devapp042dbs …
Lost
  • 12,007
  • 32
  • 121
  • 193
0
votes
1 answer

Does SQLMetal support SQL-Server 2008 datatypes?

I'm using LinqToSQL in a 3.5 framework project in VS2K8, running against MS SQL 2k8. When I create the table mappings using the design surface within Visual Studio everything works fine. When I create the table mappings using SQLMetal (from the…
Marc
  • 3
  • 1
0
votes
1 answer

Executing LINQ Queries In Excel To SQL

I want to be able to interact with an SQL database using LINQ and Excel (it's a legacy thing). Is this sort of thing possible? I'm screwing around with SQLMetal, and have generated some database classes in VB, but they don't seem to go in…
sooprise
  • 22,657
  • 67
  • 188
  • 276
0
votes
1 answer

Ling To Sql: Incompatible Database version

I created a local database file (Sql Server Compact database file) in Visual Studio with the extension .sdf and I was using SqlMetal.exe to connect Linq to my Sql database file. However it gives me an error, saying that Incompatible Database…
Hoang Minh
  • 1,066
  • 2
  • 21
  • 40
0
votes
1 answer

SqlMetal, Sql Server 2008 database, Table with HierachyID, dal cs file is created sometimes?

I have 2 databases with a 2 tables with HierachyID fields. For one database I can get a dal cs file, for the other database I cannot get a dal cs file ? HBus is a database I can get the dal cs for, ... SqlMetal /server:.\SQLSERVER2008 /database:HBus…
user206890
  • 531
  • 6
  • 17
0
votes
2 answers

How to add a SqlMetal build step in VS2008?

I've created a one-line batch file to run SqlMetal to regenerate a LINQ to SQL DataContext for my database; this works great. Refresh_DataContext.bat: "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\sqlmetal.exe" /server:.\sqlexpress…
0
votes
2 answers

How to give table information in the SQl METAL Command Line Tool

How do we mention the Table information in the command when we want to generate the external mapping file directly from the database. We have the /Database option but how do we mention the table information
Rishabh Ohri
  • 1,280
  • 4
  • 16
  • 28
0
votes
2 answers

Is SqlMetal a good solution for mapping to a database that contains *only* tables?

I'm thinking of using SqlMetal to auto-generate LinqToSql code for a simple and small database. The database will have only tables with some primary and foreign keys (i.e., no views, stored procedures, functions, etc.). I'd like to do all joins,…
devuxer
  • 41,681
  • 47
  • 180
  • 292
0
votes
1 answer

SQLMetal - Foreign Key Constraint with multiple fields - Error

When I try to run SQLMetal on a sqlite database which defines a foreign key constraint on multiple fields, i get an error. The table is as follows: CREATE TABLE A ( a1 INTEGER, a2 INTEGER, PRIMARY KEY (a1,a2) ); CREATE TABLE B ( b1…
M.S.
  • 442
  • 3
  • 13
0
votes
1 answer

Making mono's SqlMetal understand user/extension defined types in PostgreSQL

I'm trying to port my rails webapp to C#(mono), and I want to use the same database. When I try to create the Linq schema using sqlmetal I get this error message: sqlmetal: System.ArgumentException: Don't know how to convert the SQL type 'name' into…
Idan Arye
  • 12,402
  • 5
  • 49
  • 68
0
votes
4 answers

Generation custom files from dbml file?

I've been having a look at making changes to the partial classes generated from a DBML file. I was reading into using the sqlmetal.exe tool but it appears that you can't do much customisation of what it actually spits out. I'm wanting to make…
Fermin
  • 34,961
  • 21
  • 83
  • 129
0
votes
1 answer

Error in C# using LINQ to SQL and sqlmetal System.InvalidCastException: Specified cast is not valid

When running some code I've written on our production server or another developers machine it crashes on this line. Ac_CalcDetail xy = db.Ac_CalcDetails.Where(chld => chld.CalcIdent.Equals(CalcIdent)).First(); CalcIdent is just a guid as a string. …
Daniel Gent
  • 91
  • 1
  • 6