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

How do you secure your configuration files to be accessed remotely by unauthorized users?

0 Answers  


What is ISAPI?

2 Answers   IBM,


What is asp.net mvc5? : Asp.Net MVC

0 Answers  


What is role manager work in web.config? how to restrict perticular pages from the users using the role manager?

1 Answers   Patni,


Can the unique key be null?

0 Answers  






What is difference cookie and session?

0 Answers  


Can I combine classic asp and asp.net pages?

0 Answers  


Difference between ASP & ASP.NET Session State

1 Answers   Cognizant, Wipro,


What are demand-paging and pre-paging?

0 Answers   MCN Solutions,


What is a page life cycle?

0 Answers  


can i call the java script to code behind file?if yes how?

4 Answers   Wipro,


Explain the difference between AutoPostBack and IspostBack in ASP.NET?

0 Answers   Sans Pareil IT Services,


Categories