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 is query string in asp.net?

0 Answers  


What is special types forms

0 Answers   MCN Solutions,


Explain the main differences between asp and asp.net?

0 Answers  


Explain server control extensibility with reference to asp.net 2.0 ?

0 Answers  


When we are requesting a new URL through Response.Redirect() the new page wil open on the new browser window or it wil open in the same window? If we use Server.Transfer() what wil happen?

1 Answers  


How to use push notification?

0 Answers   MCN Solutions,


How does output caching work in ASP.NET?

0 Answers  


What is the adavantage of using ASP.NET routing?

0 Answers   NA,


What is state management technique?

0 Answers  


When is validation done on the client? How does client-side validation improve the efficiency of an application?

1 Answers  


Can anyone please tell me that the question posted on this website are Sufficient for the interview with 2+ year experience in .net

0 Answers  


What methods are fired during the page load?

2 Answers  


Categories