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
Describe session handling in a webfarm?
Why is global asax is used?
How can we register exception filter globally?
Whta are the Various steps taken to optimize a web based application (caching, stored procedure etc.) ?
In which situation can you not use a viewstate?
Explain the main function of razor in asp.net? : asp.net mvc
What is viewstate? What does the "enableviewstate” property do? Whay would I want it on or off?
What is the current version of asp.net?
Explain what is an abstract class?
How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?
Explain file-based dependency and key-based dependency.
What is .net remoting?
Is data edited in the Repeater control?
How to send a DataReader as a parameter to a remote client ?
Is asp.net and .net same?