How to execute a stored procedure.and how to call it form a
asp page

Answer Posted / ramesh

This u cn run in sql server

"execute SP_Name Parameter1,Parameter2,..."

Dim SQLDBDataReader As SqlClient.SqlDataReader
Dim SQLDataTable As New DataTable

SQLCmd.CommandText = "GetAuthors"
SQLCmd.CommandType = CommandType.StoredProcedure
SQLCmd.Connection = SQLCon
SQLCmd.Parameters.Add(New SqlClient.SqlParameter
("AuthorName", SqlDbType.VarChar, 100,
ParameterDirection.Input, False, 30, 0, "",
DataRowVersion.Current, "Y%")) SQLDBDataReader =
SQLCmd.ExecuteReader() SQLDataTable.Columns.Add
("AuthorName", GetType(Int32), "") SQLDataTable.Columns.Add
("AuthorLocation", GetType(String), "")

Dim FieldValues(1) As Object 'A Temporary Variable to
retrieve all columns in a row and fill them in Object array

While (SQLDBDataReader.Read)
SQLDBDataReader.GetValues(FieldValues)
SQLDataTable.Rows.Add(FieldValues)

End While

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we go for mvc instead of asp.net? : Asp.Net MVC

731


What is new asp.net core?

796


Which type of state management is provided by Query String in ASP.NET?

794


Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?

883


Where session id is stored?

740


What can we do with asp.net?

714


What is server components?

768


What is the use of autowireup in asp.net?

771


Explain the difference between singleton and single call?

766


How do I create a web form?

728


How many types of session in ASP.NET

833


What are standard controls?

714


how to implement some securty aspect in our application i.e 1.cookie poisioning. 2.data encryption. 3.forcefull browsing 4.sql/code injection 5.securing web app by using web services ........my question is how to implement these thing in our application is this done by hard coding or by help of some tool

1887


What is .net framework and what are the main components of it?

593


What is a 401 redirect?

711