ADO.NET provides the SqlCommand object which provides the functionality of executing stored procedures.
Note :- Sample code is provided in folder “WindowsSqlClientCommand”.There are two stored procedures created in same database “Employees” which was created for the previous question.
CREATE PROCEDURE SelectByEmployee @FirstName nvarchar(200) AS Select FirstName from Employees where FirstName like @FirstName + '%'
CREATE PROCEDURE SelectEmployee AS Select FirstName from Employees
If txtEmployeeName.Text.Length = 0 Then
objCommand = New SqlCommand(“SelectEmployee”)
objCommand = New SqlCommand(“SelectByEmployee”)