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 is the caspol.exe tool used for?
How u refer webservices?
When was asp.net released?
What are sql notifications and sql invalidations?
They mostly asked difference between versions of technologies
What is synchronous and Asynchronous post back ?
What are the security types in asp.net?
How many types of state management are there in asp net?
What is razor? : asp.net mvc
What are the differences between code behind and code inline?
How to use multiple scriptmanager controls in a web page?
What are the file extensions for razor views?
Describe the disadvantage of cookies.
What is custom attribute? How to create?
What is the default authentication mode for asp.net?