Initially, I have tried to use stored procedure. But I changed my mind and preferred to call sql query in codebase with command text. However, it stills tries to find initially-called stored procedure (which is neither called or exists).I think that it is related caching. But I tried it with different browsers it did not work.What might be the reason?
Is it possible to save execute stored proc command in a string variable and then execute string variable? Does this logic fits into LINQ2SQL? Why I want to do this - INstead of passing user control references to server, I want to save user control values to string in client side java script and then pass string to server to do actual stored proc execution. Hopefully this will improve performance.
I need to run a stored procedure from an aspx page but because it takes a long time to complete, it times out at MyDataAdapter.Fill. This sp doesn't return any recordset but the number of records affected would be nice.
Protected Sub BtnProcessDT_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnProcessDT.Click Dim DS As DataSet Dim MyConnection As SqlConnection Dim MyDataAdapter As SqlDataAdapter MyConnection = New Global.System.Data.SqlClient.SqlConnection MyConnection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("RevConnectionString").ConnectionString MyDataAdapter = New SqlDataAdapter("uspINSERTDT", MyConnection) MyDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure MyDataAdapter.SelectCommand.Parameters.Add(New SqlParameter("@RowCount", SqlDbType.Int, 4)) MyDataAdapter.SelectCommand.Parameters("@RowCount").Direction = ParameterDirection.Output DS = New DataSet() 'Create a new DataSet to hold the records. MyDataAdapter.Fill(DS, "RowCount") 'Fill the DataSet with the rows returned. Basic syntax of the stored procedure. It SELECTS a single record (at a time) from a table, processes the data and UPDATES four other tables. ALTER PROCEDURE [dbo_DHT].[uspINSERTDT] (@RowCount INT OUTPUT) AS BEGIN select @RowCount=@@ROWCOUNT END
Do I need to create a DataSet if all I want to do is capture the number of records? How do I increase the timeout? This is strictly an intranet web application used by one person so performance isn't a big priority. Editing the sp to reduce the amount of time to process isn't practical due to the amount of processing that occurs.
VS2005 Version 8.0.50727.42 (RTM.050727-4200) .NET framework version 2.0.50727.3603 SQLExpress 2005 9.00.3042.00
I've searched and searched for this all day, but can't seem to find the answer. I'm looking to execute a stored procedure by clicking a button. I've set this up in a code behind manner, rather than using a datasource.
The stored procedure doesn't return any rows. All I need to do is pass a variable through it. I think I have it set up correctly, however it keeps saying the stored procedure expected the @pin variable. Here's my code:
I've tried changing sp1 to pin and @pin, thinking that was the problem. Am I missing something?
basically i have two dropdown boxes to filter data and textbox with stored procedure bound to gridview.i want to be able to query data depending on the selected value passed,either using one or more parameter values.
i would like seperate sqlcommands to chose from depending on which controls i select to pass parameters.
i have included a parameter Select(control id) as this is declared by the wizard for stored procedure.
but i am not sure how it is defined on the page and passed to procedure.
sing VS 2008 at a workstation, I have successfully developed a local, file-system ASP.NET 3.5 website. The wbesite included a membership page with Windows authentication and a web parts page. The SQL Server 2005 ASPNETDB database has been created at an IIS web servr. Using the ASP.Net development server of the workstation, both the membership Membership/WebParts pages at the local website worked very well.
Then, I copied the website to a virtual directory at the IIS web server and creates a remote website for the workstation. Under theASP.NET development server of the workstation, both membership and webparts pages of the remote website at the IIS web server also worked fine.
However, when running these web pages from the IIS web server machine, something wrong happened with the web parts page. (The membership page still worked very well.) For the ASPNETDB database at the IIS web server machine, there is an EXECUTE permission error on an ASPNET stored procedure.
What are the differences between the ASP.NET development server and IIS web sever, which caused the EXECUTE permission error on the ASP.NET S.P.? How to find and fix the errors?
The database I am using has a schema called EQB and as such, my stored procedures are named as EQB.usp_SelectFunds, EQB.usp_SelectAccount, etc.
On the select tab of the Configure Data Source screen, I choose to use a stored procedure. The dropdown shows my stored procedures, however, the schema name does not show up in front of the stored procedures in the drop down. I see only usp_SelectFunds, usp_SelectAccount, etc.
I select one of the stored procedures and when I click TEST, I get the message that the stored procedure is not found. If I instead choose to use a SQL statement instead on the configuration screen and enter EXEC EQB.usp_SelectFunds and click TEST, it works fine.
Why are my stored procedures not showing up correctly in the stored procedure drop down and how can I fix this?
I am looking through a sql stored procedure which I might need to update in the near future. Basically the stored procedure is about 20 lines long. The stored procedure first builds a query
and stores it in a variable named "@Sql". And then for the last two lines of the stored procedure it appears that the big sql statement stored in "@Sql" is executed by using the "EXEC" command. See below. What is confusing though is that the query appears to be exectuted twice? Why was the query written in this way. Don't both lines do the same thing? Why is it being done twice? Could this possibly be a mistake on the part of the person who wrote the query. Below are the two lines I am talking about?
I am trying to execute a stored procedure in LINQ. When run in SQL Server it returns several fields, mostly integer and float fields. But when I call the stored procedure in LINQ, all it returns is 0. Here is how I am calling the stored procedure :
I have a stored procedure in SQL server 2000. It is a simple select query and returns a list of account names. However, when I try to execute the stored procedure, it automatically declare @return_value as int and return this int as shown below:
how can I create stored procedure and write my select statement in it, I know how to create dataset then put type stored procedure and assign it to the sp ... what I want is writing my sp... how can I make it ?
check the following code, this is what I want to write put I don't know where or how !
In my stored procedure there are 8 queries for 8 tables.Each query has joins and sub queries. I am passing parameters & stored procedure name from front end(designed in asp.net 3.5) can we execute that 8 queries at the same time i.e. parallel execution so that I can minimize stored procedure execution time?
I am getting frustrated with this problem, I dont know what i did, but now I cannot execute any stored procedured when I could last time.When I use my asp.net application to run the query, it finds the stored procedure but when I execute it is sql management studio it says it cannot find the stored procedure even though it is there.I tried to execute other procedures and the samething happens. Even when I try a simple query it says it cannot find the tableI could execute the query if i placed Use [databasename] in front, but even with this, I cannot execute stored procedures.