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
Whats the difference between registerclientscriptblock, registerclientscriptinclude and registerclientscriptresource?
How can you pass multiple complex types in Web API?
Is post back property in asp net?
What is side-by-side execution? Can two applications, one using a private assembly and other using a shared assembly, be stated as side-by-side executables?
How will you maintain versioning in asp.net 2.0?
What is the difference between client-side and server-side validations in ASP.NET?
Which method is used to force all the validation controls to run?
How will you do Redo and Undo in a TextControl?
How should I destroy my objects in asp.net?
what is AutoEventWireUp and what is the use of This property explain in details?
How many types of Cookies are available in ASP.NET?
What is use of Master Page in ASP.NET web pages?
What is http only cookie?
What are Master Pages in ASP.NET? or What is a Master Page?
Explain MVC model binders?