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

Define repository pattern in mvc.net? : asp.net mvc

0 Answers  


Compare and contrast between inline and code behind - which one is best?

2 Answers   Siebel,


What is session in asp.net?

0 Answers  


Where code pages are used?

0 Answers   Blue Star,


Can we throw exception from catch Block?

9 Answers   Accenture, IBM,






Do you know caching feature?

0 Answers  


How Session outproc in Sqlserver stored?

0 Answers   CGI,


what is session ?how sessions are handeled in application? write the clauses of sql server in their order.

3 Answers   Olive Tech,


What's the difference between Page.RegisterClientScriptBlock and Page.RegisterStartupScript ?

1 Answers  


Dategrid filtering and sorting How can we sort all the fields at once?

3 Answers   Satyam,


How to retrieve data row by row from a DataTable? Thanks In advance PriyaPP

3 Answers  


What are different transaction options?

2 Answers   Astadia,


Categories