I have a stored procedure for getting user details. In that there is one input parameter i.e. @UserName. Here is my stored procedure
USE [Test]
GO
/****** Object: StoredProcedure [dbo].[GetUserByUserName] Script Date: 6/12/2013 6:59:49 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GetUserByUserName]
(
@UserName VARCHAR(100)
)
AS
BEGIN
SET NOCOUNT ON
BEGIN TRY
SELECT UserID,
FirstName,
LastName,
UserName,
Password,
PasswordUpdateDate,
MembershipType,
IsActive
FROM Users
WHERE UserName = @UserName
END TRY
BEGIN CATCH
EXEC ThrowError
END CATCH
END
I want to execute this procedure using Linq to Sql in WCF. I want to return result in DataTable Object.