.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 4th, 2004, 07:49 AM
inancgumus inancgumus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 2 inancgumus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Performance Problem

Hello,

When querying the same sql server with the same query (actually it is a stored procedure) i can show the results in 50sec. But, querying the same sql server with the same query takes more than 20minutes !! How come ?..

You can show the code at below:

[cs]
SqlConnection cnn = new SqlConnection(xx.MiddleTier.Common.Config.Connecti onString);
cnn.Open();

SqlCommand cmd = new SqlCommand("GetStatisticsByCampaignIdInDateRange", cnn);
cmd.CommandTimeout = 0;
cmd.CommandType = CommandType.StoredProcedure;

SqlParameter paramCampaignId = new SqlParameter("@campaignId", typeof(int));
SqlParameter paramDateFrom = new SqlParameter("@dateFrom", typeof(DateTime));
SqlParameter paramDateTo = new SqlParameter("@dateTo", typeof(DateTime));

paramCampaignId.Value = campaignId;
paramDateFrom.Value = starts;
paramDateTo.Value = ends;

cmd.Parameters.Add(paramCampaignId);
cmd.Parameters.Add(paramDateFrom);
cmd.Parameters.Add(paramDateTo);

//cmd.Prepare();

SqlDataReader r = cmd.ExecuteReader(CommandBehavior.CloseConnection) ;
cmd.Dispose();

dgReportingTable.Visible = true;
dgReportingTable.DataSource = r;
dgReportingTable.DataBind();
[/cs]
Thanks.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Performance Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT