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
hi .net gurus. plz if any one has dumps on 70-631 and 70-541 on windows sharepoint services kindly mail me.
What are sql notifications and sql invalidations?
14. What are your Future Plans for Swatz Oils GROUP U.K?
Is it possible to apply themes to an asp.net application? If yes, then how?
Is it possible to develop a single web application using ASP.NET webforms and ASP.MVC?
To display data in a Repeater control which template you provide?
Mention few asp.net validators.
What is application and session in asp.net?
How do I publish my asp.net application to my isp's web server?
What is the difference between web.config and machine.config in ASP.NET?
What is asp.net used for?
What is a user developed application?
When should I use server transfer and response redirect?
What's the ASP.Net Application life cycle?
What are session state modes? List some of the important session state modes of asp.net.