473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

SqlMetal & IUD procs

Hi,

I use procs for my data access, instead of allowing direct inserts and
updates to tables. How can I get SqlMetal to generate code that will
use procs? I know the designer you can Configure Behavior to do
this.. is there no equivolent in Sql Metal?

Thanks
Jun 27 '08 #1
3 1932
Well, one of the SqlMetal options is to output the dbml (an xml file).
Dbml can be edited (by hand or automated), then you can use SqlMetal
again to generate code from the edited dbml file. To quote from "/?":

Generate intermediate dbml file from SqlServer:
SqlMetal /server:myserver /database:northwind /dbml:northwind.dbml /
namespace:nwind

Generate code with external mapping from dbml:
SqlMetal /code:nwind.cs /map:nwind.map northwind.dbml

I don't think the /map is necessary - i.e. I suspect you coud use /
code:{outfile.cs} {infile.dbml}

Marc
Jun 27 '08 #2
Sorry - I forgot to say; to investigate how to link to stored
procedures, the easiest option is to edit a test file via the designer
and see what it does to the .dbml file.

Marc
Jun 27 '08 #3
On Apr 28, 4:44 pm, Marc Gravell <marc.grav...@gmail.comwrote:
Sorry - I forgot to say; to investigate how to link to stored
procedures, the easiest option is to edit a test file via the designer
and see what it does to the .dbml file.
Hi,

I've been looking at the code the designer generates. I know what it
does to use SPs instead of direct updates, but I was hoping that
there'd be some way to automate all of that work. It basically
amounts to a private method with a specific name / signature, which in
turn calls whatever stored proc. There's some trickery to it though,
since you can't pass value types by reference and so temp variables
are declared and used to manually copy the values back and forth.

I guess there's nothing right now to easily automate what I want...
I'll have to think of something.

Thanks
Andy
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Michael | last post by:
Hi Everyone, I'm currently using VS 2005 and would like to use the databinding of the controls to help ease up some of the coding I have to do (some of my forms have over 120 fields). The problem...
0
by: hammad.awan_nospam | last post by:
Hello, I have used SqlMetal to generate the Dlinq classes for my database schema. I have created instances of those classes and then tried binding them to a PropertyGrid object through it's...
2
by: Matthew Tylee Atkinson | last post by:
I appear to be having some problems with the isAlive() method of detecting if a thread is alive/active/running or not. I'd be grateful for any advice. I have a visualisation program (which uses...
8
by: Frank Calahan | last post by:
I've been looking at LINQ and it seems very nice to be able to make queries in code, but I use stored procs for efficiency. If LINQ to SQL only works with SQL Server and stored procs are more...
0
by: Robson Felix | last post by:
Folks, I've been trying to put some legacy databases I have here through SqlMetal. Most of it goes well, but in some stored procedures, I get errors for temp tables that don't exist and so on. I...
0
by: Andrus | last post by:
I use sqlmetal to generate cs code. sql metal generates property attributes in form public string Floorlimit { .... I need to specify that this property is discriminator. Since C# does not...
2
by: =?Utf-8?B?Sm9lcm4gU2Nob3UtUm9kZQ==?= | last post by:
I am trying to execute the sqlmetal util with the following command line arguments /provider:SQL2005 /database:bookshelf_dev /code:SqlMetal.cs This gives me the following error: Error :...
0
by: Joern Schou-Rode | last post by:
In the database (SQL2005) that I am working on, the tables are divided into a few schemas, which are used to restrict permissions for certain users. When autogenerating entity classes thorugh the...
2
by: Big Daddy | last post by:
For example, if I have a DB table called DownloadPoints with a column named DownloadPointNo, then SqlMetal will create a file with a class called DownloadPoints with an accessor named...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.