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
Why we go for mvc instead of asp.net? : Asp.Net MVC
What is new asp.net core?
Which type of state management is provided by Query String in ASP.NET?
Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?
Where session id is stored?
What can we do with asp.net?
What is server components?
What is the use of autowireup in asp.net?
Explain the difference between singleton and single call?
How do I create a web form?
How many types of session in ASP.NET
What are standard controls?
how to implement some securty aspect in our application i.e 1.cookie poisioning. 2.data encryption. 3.forcefull browsing 4.sql/code injection 5.securing web app by using web services ........my question is how to implement these thing in our application is this done by hard coding or by help of some tool
What is .net framework and what are the main components of it?
What is a 401 redirect?