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
What are the built-in objects in asp.net?
What is scope of an application variable in asp.net?
Why we use asp.net for website development?
How to turn off cookies for a page?
What is ispostback property?
Explain the use of errorprovider control in .net?
Are xaml file compiled or built on runtime?
Explain the use of fragment caching.
How do you implement sql caching in asp.net?
What are the various types of validation controls provided by asp.net?
Explain an object, class and method.
What is the difference between a multi-layer and multi-tier applications?
Briefly describe the role of global.asax?
What is asp.net caching?
What is the difference between a candidate key and primary key?