ADO.NET ::stored Proc That Takes A Bit Long To Run?
Aug 13, 2010I have a stored proc that takes a bit long to run. I tried to do this command.CommandTimeout = 200;still gets time out within 200 secs.How is this done?
View 1 RepliesI have a stored proc that takes a bit long to run. I tried to do this command.CommandTimeout = 200;still gets time out within 200 secs.How is this done?
View 1 Repliesi have two stored procs. when th 1st stored proc runs i want to be able to use this value returned from the stored into another stored proc.
my first stored proc is:
[Code]....
which returns [Transfer_stations_Authority_name] = 'Blackpool'
now i want to use this value into my second stored proc@
[Code]....
[Code]....
Retrieving image from sql database, on pageload takes too long, sometimes 6-8 seconds long. That is too much time to retrieve a binary file and display it on image button. How can I retrieve image in just 2 seconds?
View 1 RepliesOne of my web pages populates a droplist with about 60k items pulled from SQL Server, and this operation takes upwards of 10 seconds to complete. Are there some tricks or optimizations I can try to improve performance? I'm using a SqlDataSource configured as a DataReader.
View 5 RepliesIn development, our Asp.Net 4 website takes a fairly lengthy time to start after the project libraries are built
We do a fair amount of population of statics etc, but not enough to justify the length of time it takes the app to come up (probably 3-4 minutes)
We aren't building the website, just the libraries, and batch != true in the compilation element in the .config file.
I will try log some diagnostics, but any other pointers would be useful
Project
I'm running a single page (default.aspx) web site in Visual Studio 2010. I have a few other projects in the solution, but they're all taken out of the build queue at the moment. I'm using Visual Studio Development Server as the web server (I haven't tried IIS yet). I'm using the HTML5 Boilerplate from [URL] I'm testing in Chrome and IE8
Problem
Visual Studio 2010 is outputting "Debug" information to the Output window every time I refresh my browser. Whilst this isn't a problem in itself, it seems to be extremely slow in doing so... it takes around 4 seconds to show the page in full from initial refresh.
I've noticed that the "Script Documents" folder appears in my solution view, and some files (notably JS files) seem to take a while to show up. I've tried removing all the JS and CSS file references from my page, but it still does it.
So, to troubleshoot I've created an index.aspx page with no content apart from the generic ASP.Net template code, set this as the start page, but it still takes just as long to load up as the other page.
As a last resort, I've created a new project and tried it with no changes to the default page - still the same, takes a few seconds to finish loading in either browser.
The strange thing is that this happens even when I stop debugging in Visual Studio and browse directly to the URL on the ASP.NET Development server.
Output Windows contents when page is refreshed
[Code]....
Whenever I stop debugging an ASP.NET IIS web application it seems to take very long before VS2010 becomes responsive again (2 or 3 minutes). This happens when I close Internet Explorer 9 (which stops the debugging session), stop debugging in VS (which closes the browser) or when I detach the debugger from the debugging menu (which leaves the browser open).
My CPU time for devenv.exe goes up to 25% during this period of time. I use the professional edition (no intellitrace). Starting without debugging performs ok when I close the browser. I have some add-ins and extensions installed like TestDriven.NET, Resharper, PowerCommands, Productivity Power Tools, VisualSVN,...
Checkout/Checkin takes a long tim
View 1 RepliesThere is a table contains thousands of records. when I run this query:
[Code]....
The application stucks...it takes too much time to execute this query...
What might be the reason for that?
Linq code sometimes takes too long to execute
View 4 RepliesI have selected around hundred data and then bind to the repeater each times it take a long time to save data after clicking the save button. How can i improve the performance?
View 6 Repliessaving my aspx file takes too long, it has some nested tables, but it is nothing huge, it has like 50+ overall controls on the form. When I hit the save button, it takes a few minutes and drives cpu crazy, so I am guessing it is doing something in the background.
So, what is the reason, any clues how to speed this up?
I am using Vs.Net 2010 Ultimate
I am working on a website hosted with GoDaddy, SQL Server 2005. I have a table in my SQL Server database with a full-text index. On my website, a user can type in search terms and the terms are then passed to a stored procedure in the database which performs the search. The first search takes about 45 seconds to get results. Subsequent searches return results immediately. I found a description of this problem in a Microsoft knowledgebase article:http://support.microsoft.com/kb/915850/en-usGoDaddy tech support says I need to purchase a dedicated server to make the changes suggested in this article.Surely there is some other solution. Does anyone know how to avoid this delay without changing the server configuration?
View 1 RepliesMy function isn't returning anything - strReturn is empty:
[Code]....
When I execute this stored proc using 'exec GetMerchantLocationZip (3333, 373773)' I get the correct zipcode in SQL. Why don't I get it in Visual Studio?
[Code]....
I am learning, so apologies if it's a obvious error.
I am attempting to execute a stored proc in asp.net in the code behind. The parameter I am trying to pass is strErrorMessage that contains a value of "The transport failed to connect to the server.; ". The error message when the query gets executed is: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 ("@errMessage"): Data type 0xE7 has an invalid data length or metadata length. Update with code
try
{
...
...
...
}
catch (Exception ex)
{
ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Email was not sent - " + ex.Message + "');", true);
string strMessage = ex.Message;
string strStackTrace = ex.StackTrace;
strMessage = strMessage.Replace("
", "; ");
strMessage = strMessage.Replace(" ", "");
strStackTrace = strStackTrace.Replace("
", "; ");
strStackTrace = strStackTrace.Replace(" ", "");
AppErrorLog(strMessage, strStackTrace);
return false;
}
protected void AppErrorLog(string strErrorMessage, string strErrorStackTrace)
{
SqlConnection conErrLog = new SqlConnection(strConn);
string sql = "usp_AppErrorLog_AddRecord";
SqlCommand cmdErrLog = new SqlCommand(sql, conErrLog);
conErrLog.Open();
try
{
cmdErrLog.CommandType = CommandType.StoredProcedure;
cmdErrLog.Parameters.Add(new SqlParameter("@errMessage", SqlDbType.NVarChar, 8000));
cmdErrLog.Parameters["@errMessage"].Value = strErrorMessage;
cmdErrLog.Parameters.Add(new SqlParameter("@errStackTrace", SqlDbType.NVarChar, 8000));
cmdErrLog.Parameters["@errStackTrace"].Value = strErrorStackTrace;
cmdErrLog.Parameters.Add(new SqlParameter("@userID", SqlDbType.VarChar, 12));
cmdErrLog.Parameters["@userID"].Value = User.Identity.Name;
SqlDataAdapter ada = new SqlDataAdapter(cmdErrLog);
cmdErrLog.ExecuteNonQuery();
}
catch(Exception e)
{
ClientScript.RegisterStartupScript(GetType(), "alert", "alert('AppErrorLog - " + e.Message + "');", true);
}
finally
{
conErrLog.Close();
}
}
The column datatype in the table is nvarchar(MAX).
i have the following stored proc that inserts data into a database based on a stauts field. the first stored proc inserts into the first table and i am trying to get the identity field out as i need this value for the next stored proc. the first stored proc works fine and inserts the data but the secnd one doesnt, even though there is data there.
[Code]....
I am trying to pass stored procedure from a controller to view. In my Home controller, in Index method, I have this. CustOrderHist is my stored procedure from northwind database.
public ActionResult Index()
{
DataClasses1DataContext dc = new DataClasses1DataContext();
var products = dc.CustOrderHist("ALFKI").GetEnumerator();
return View(products);
[Code]....
I have written a stored proc for raise error.Whenever a customer checks for a record in the DB that doesn't exist in the DB he has to get an error displayed.I have written a stored proc help me on it i know it is wrong suggest me the correct one.
[Code]....
DECLARE
CUR_EMP_BIR REF CURSOR;
BEGIN
dbname.EMPLOYEE_P.EMPLOYEEBIRTHDAYSEL ( CUR_EMP_BIR );
END;
ORA-06550: line 2, column 19:
PLS-00201: identifier 'CURSOR' must be declared
ORA-06550: line 2, column 15:
PL/SQL: Item ignored
ORA-06550: line 5, column 45:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 5, column 3:
PL/SQL: Statement ignored
[code]...
I have made a simple stored proc which include Transaction through which I have to delete records from two tables EmpDetail and EmpDept . EmployeeId is PK in EmpDetail and FK in EmpDept. Procedure has been executed but on doing exec DelEmployee @EmployeeID='e07' showing 0 rows affected..
[Code]....
I've been self teaching SQL and asp.net and i'm a little stuck. I have a stored proc for the insert and then in my Insert inside my class it's not returning the ID after the insert as I am receiving an error message that NULL value has cannot be inserted. I want to add default values to a seperate table after the insert. I will provide my code below, if anyone can help me why the value is not going across?
[Code]....
i am trying to write a stored proc that takes data from one table based on a field in that tabke and writes that data out to another table with the eventual idea that this data is deleted from the original table it was read from. my stored proc is as follows:
[Code]....
but i keep getting an error: incorrect syntax near 'BACKUP_TWS_Waste_Colection_Request'.
I hope to one day figure this looping records from a table to update it, but i cannot get this to complie, I guess cause I am not
versed in looping in sql yet :(
[Code]....
I just want to get data from a table per record run the stored procedure(i have nesting on) and update the record's fields with the values that were returned from the Store procedure. The Stored procedure is working fine.
I'm converting Active X code in DTS to Script Task for SSIS and I'm having trouble creating an XML file from my stored proc. Here's the code:
[Code]....
It throws an error on the dataAdapter fill saying:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '<'.
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near '<'.
Msg 132, Level 15, State 1, Line 5
The label 'sql' has already been declared. Label names must be unique within a query batch or stored procedure.
I want to have a stored procedure which will accept a Datatable from .NET application and the tablename and will loop thru' each record in the Datatable and insert it into the table. It will insert the bad records into a bad file. Also how to send the datatable to the proc,what kind of parameter to use.
Pls post the code for this proc.