You can write stored procedure either in database or in .NET IDE. It can be executed as follow:
'Coding
Dim strProcedure as string = "ProcedureName"
Dim objcommand as New SqlCommand(strProcedure,"..connection string...")
objcommand.Commandtype = CommandType.StoredProcedure
'Then you can create Dataset or Datareader using this StoredProcedure
Yes, if you are writing Procedure then you will have to pack it in PROCEDURE name like:
CREATE PROCEDURE procedure_name
'code for procedure
I hope it will help you.
Gaurav
|