Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Describe session handling in a webfarm?

992


Why is global asax is used?

1024


How can we register exception filter globally?

984


Whta are the Various steps taken to optimize a web based application (caching, stored procedure etc.) ?

1026


In which situation can you not use a viewstate?

951


Explain the main function of razor in asp.net? : asp.net mvc

1077


What is viewstate? What does the "enableviewstate” property do? Whay would I want it on or off?

910


What is the current version of asp.net?

1003


Explain what is an abstract class?

1014


How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?

999


Explain file-based dependency and key-based dependency.

970


What is .net remoting?

1041


Is data edited in the Repeater control?

1038


How to send a DataReader as a parameter to a remote client ?

3407


Is asp.net and .net same?

969