Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Executing a select SP in visual studio??? (http://www.go4expert.com/forums/executing-select-sp-visual-studio-t13504/)

Twice 2Sep2008 02:03

Executing a select SP in visual studio???
 
i created a stored procrdure that checks for duplicates in a database when importing data from a spreadsheet.When i try to execute the SP in visual studio using ExecuteNonQuiry() it throws that says executeNonQuiry does not execute select statements.

Is there any other way for me to execute this quiry.plz help.Here is the stored procedure
Code:

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER PROCEDURE [dbo].[ChkDup]

@StudentID nvarchar(50),

@ModuleCode nvarchar(50)

AS

if exists(SELECT COUNT(StudentID),COUNT(ModuleCode)

FROM StudentID

Group By StudentID

HAVING COUNT(StudentID) < 1 AND COUNT(ModuleCode) < 1)

INSERT INTO StudentModule(StudentID,ModuleCode)

VALUES(@StudentID,@ModuleCode)



All times are GMT +5.5. The time now is 12:31.