How to execute a stored procedure.and how to call it form a
asp page

Answers were Sorted based on User's Feedback



How to execute a stored procedure.and how to call it form a asp page..

Answer / 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

How to execute a stored procedure.and how to call it form a asp page..

Answer / sdfsd

exec storedprocedure parameter
sqlhelper cs=new sqlhelper();
cs.parameter.add("name",type).value=value
cs.execD

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

What do you understand by aggregate dependency?

0 Answers   MindCracker,


Your manager has asked you to describe what you would use application variables for. What statement best describes the use of application variables? a) Application Variables are used to keep state for each connected user. b) Application Variables are used to keep state for the web site c) Application Variables are used to keep state for the application on the server d) Application Variables are used to keep state for all applications objects in the web site.

1 Answers   Syntax Softtech,


What is an il?

0 Answers  


What are cao and sao.

0 Answers  


How do I upload a file from my ASP.NET page?

0 Answers  


what is the difference between server.Transfer and response.redirect in .net

1 Answers  


How to kill more than one session variables at a time

9 Answers   iSoft,


what is difference between java and .net

11 Answers   Base2 Infotech, Karur Vysya Bank KVB, TATA AIG, TCC,


How can you make sure that web api returns json data only?

0 Answers  


Why do you use the app_code folder in asp.net?

0 Answers  


Types of object in asp ?

1 Answers   Accenture,


COM+ Used ________________ Isolation Level

0 Answers   CTS,


Categories