CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_web_developer_2008_express Tags:
Item Type: NewsGroup Date Entered: 8/22/2007 2:03:55 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 25 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
algoaddict
Asp.Net User
writing stored procedures in linq to sql8/22/2007 2:03:55 AM

0/0

 can i use linq in order to create user defined objects in managed code for sql server ?

for instance, instead of using this code:

sing System;
using System.Data.SqlTypes;
using System.Data.SqlClient;
using Microsoft.SqlServer.Server;

public class StoredProcedures
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void PriceSum(out SqlInt32 value)
{
using(SqlConnection connection = new SqlConnection("context connection=true"))
{
value = 0;
connection.Open();
SqlCommand command = new SqlCommand("SELECT Price FROM Products", connection);
SqlDataReader reader = command.ExecuteReader();

using (reader)
{
while( reader.Read() )
{
value += reader.GetSqlInt32(0);
}
}
}
}
}

 i can use any linq code for creating SP, triggers, user-defined methods, compile everything and deploy in server ?

does the sql server clr has accsess to linq in the bcl ?

 is there any link to guide me how its done ?

thanx
 

mystery
Asp.Net User
Re: writing stored procedures in linq to sql8/22/2007 6:59:10 AM

0/0

Hi

You can use LINQ 2 SQL but has nothing to do with CLR. LINQ is just mapping of your code to DB objects. What this means is if you have a SQL stored procedure you can use it with LINQ. LINQ to SQL will create managed function that call this proc and will return result for you.

Scott Gu expains in details LINQ 2 SQL in his blog.

I hope this helps.

2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Professional C# 2008 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1782, Published: 2008
Pro LINQ: Language Integrated Query in C# 2008 Authors: Joseph C. Rattz, Joseph C Rattz, Jr, Pages: 600, Published: 2007
Pro LINQ Object Relational Mapping in C# 2008 Authors: Vijay P. Mehta, Pages: 408, Published: 2008
Visual Basic 2008 Recipes: A Problem-Solution Approach Authors: Todd Herman, Allen Jones, Matthew MacDonald, Rakesh Rajan, Pages: 680, Published: 2008
Beginning VB 2005 Databases: From Novice to Professional Authors: James Huddleston, Syed Fahad Gilani, Ranga Raghuram, Jacob Hammer Pedersen, Jon Reid, Pages: 492, Published: 2007
Beginning C# 2005 Databases: From Novice to Professional Authors: James Huddleston, Ranga Raghuram, Syed Fahad Gilani, Jacob Hammer Pedersen, Jon Reid, Pages: 500, Published: 2006
LINQ, the Future of Data Access in C# 3.0 Authors: Joe Hummel, Pages: 0, Published: 2006
Programming C# 3.0 Authors: Jesse Liberty, Donald Xie, Pages: 607, Published: 2007

Web:
writing stored procedures in linq to sql - ASP.NET Forums LINQ is just mapping of your code to DB objects. What this means is if you have a SQL stored procedure you can use it with LINQ. ...
LINQ to SQL and stored procedures, my quest continues - Craig ... Mar 22, 2007 ... Yes LINQ to SQL does provide support for calling stored ... In my experience, writing a purely stored procedure abstraction to the database ...
LINQ to SQL (Part 6 - Retrieving Data Using Stored Procedures ... LINQ to SQL (Part 6 - Retrieving Data Using Stored Procedures). Over the last few weeks I've been writing a series of blog posts that cover LINQ to SQL. ...
Stored Procedures using LINQ to SQL Classes on Technorati NET without writing a line of SQL, many organizations have already determined that using ... Video: Thumbnail of Stored Procedures using LINQ to SQL Classes ...
Using Stored Procedures with LINQ to SQL Jul 17, 2008 ... How do I use LINQ to SQL with stored procedures that retrieve database records? ... Let's start writing some code inside the static void ...
OakLeaf Systems: Problems Using Stored Procedures for LINQ to SQL ... Problems Using Stored Procedures for LINQ to SQL Data Retrieval (Updated) ..... I've just finished writing Professional ADO.NET 3.5 with LINQ and the Entity ...
LINQ to SQL - 5 Minute Overview - Hooked on LINQ We have been writing queries against a type called HookedOnLINQ ... LINQ to SQL fully supports Stored Procedures for general calls and the update, ...
LINQ to SQL - Return Scalar Value from a Stored Procedure One of the best things about LINQ to SQL is that is really does have solid support for stored procedures. However, it's not quite as friendly as dynamic ...
Simon Evans' Blog : LINQ to SQL: Let the debate begin What became clear in our debates on this topic is that really all depends on who you trust more: a developer writing a stored procedure or the LINQ to SQL ...
Using StoredProcedures with LINQ 2 SQL Classes Feb 14, 2008 ... NET without writing a line of SQL, many organizations have already determined. ... Using StoredProcedures with LINQ 2 SQL Classes ...

Videos:
Stored Procedures using LINQ to SQL Classes http://blog.dmbcllc.com While it is true that LINQ will allow you to write all of your data access in .NET without writing a line of SQL, many organi...




Search This Site:










adjusting image size changes size of entire table

vwd 2008 - layout tool bar from vwd 2005

linq adding to two tables related to each other

vwd express 2008 markup error in master page - worked fine in vwd express 2008 beta -

error while browing in iis 6 -64 bit

confused about dal / linq to sql etc?!

are we getting the sqlmetal advantage in orcas express

is expression web inbuilt in ( vwd )orcas express....?

replacing colors and images

layout menu option missing

cannot view controls in mastre page and other pages with master page vwd 2008

how to create "asp.net ajax-enabled web site" in visual web developer express edition 2008

orcas and ajax

update to vwd2008? should?

vs 2008 express hang up even after hotfix, spikes to almost 300,000 memory

can't find images

run page for fast presentation

get applcation to run on iis 7.0

create .net 2.0 projects with vwd 2008 express?

silverlight in vwd 2008

designer is bodgy!

problem with report viewer in vwd2008

vs2008 - please fix automatic quote inserting finally

wcf .net 3.5: orcas intellisense

can i practice web parts and sharepoint develping with it ?

new book on visual web developer express 2008

intalling templates

linq and mysql

how to add reportviewer in visual web developer 2008 ?

alternative to ftp and frontpage?

  Privacy | Contact Us
All Times Are GMT