Avoid Too Many Queries Repeatedly To Database
Aug 31, 2010
Among methods: static variables, viewstate, session and cache for avoiding on loading repeatedly and less making queries to the database. What do you think the best method of the 4 above? I Think Cache is the best one? Or any other methods better in Asp.net 3.5 or higher?
View 3 Replies
Similar Messages:
Sep 20, 2010
i have a grid view control
[Code]....
Here change_scheduleDate function is executing every time for every row but i need to execute this function only when value change in txtdate textbox or same case i need if i create textboxchange event at serverside here i am updating txtdate value in database when text box value changed
View 2 Replies
Sep 10, 2010
I have built an asp.net web site with .net framework 3.5 and I am trying to avoid sending unncessary queries to my database in order not to have high server load. I have a login view in my master pages and it contains templates for anonymous users and members. To lighten my server load, I am using Sql Data Profiler and Database Tuning Advisor. I noticed that every page load triggers a stored procedure to get user role using
dbo.aspnet_UsersInRoles_GetRolesForUser stored procedure.
My question is that if it is necessary to check for every page load or I can store it somewhere and check later. is it Login View or Login Control sending queries? is it about access rules to member's pages? or is it because I used the login controls in my master page?
View 2 Replies
Aug 17, 2010
I'm after some thoughts on how people go about calculating database load for the purposes of capacity planning. I haven't put this on Server Fault because the question is related to measuring just the application rather than defining the infrastructure. In this case, it's someone else's job to worry about that bit! I'm aware there are a huge number of variables here but I'm interested in how others go about getting a sense of rough order of magnitude. This is simply a costing exercise early in a project lifecycle before any specific design has been created so not a lot of info to go on at this stage.
The question I've had put forward from the infrastructure folks is "how many simultaneous users". Let's not debate the rationale of seeking only this one figure; it's just what's been asked for in this case! This is a web front end, SQL Server backend with a fairly fixed, easily quantifiable audience. To nail this down to actual simultaneous requests in a very rough fashion, the way I see it, it comes down to increasingly granular units of measurement:
Total audience
Simultaneous sessions
Simultaneous requests
Simultaneous DB queries
This doesn't account for factors such as web app caching, partial page requests, record volume etc and there's some creative license needed to define frequency of requests per user and number of DB hits and execution time but it seems like a reasonable starting point. I'm also conscious of the need to scale for peak load but that's something else that can be plugged into the simultaneous sessions if required. This is admittedly very basic and I'm sure there's more comprehensive guidance out there. If anyone can share their approach to this exercise or point me towards other resources that might make the process a little less ad hoc
View 1 Replies
Aug 30, 2010
I need to do some performance testing for an ASP.NET MVC application and specifically want to measure how many database queries each HTTP request results in. The data access layer is using LINQ-to-SQL. I'd like to be able to automate the tests so am looking for a good way to be able to do a before and after count of the number of SQL queries. The possibilities I can think of are: A performance monitor counter for the ASP.NET process, A system table in the MSSQL database that can be queried before and after each page request, A property somewhere in the System.Data.SQLClient namespace that tracks the number of queries executed by the process. Has anyone done this before and can perhaps point my down the right path?
View 1 Replies
Feb 26, 2010
VWD 2008 Express. Visual Basic.
I know how to create an AccessDataSource on my aspx page and how to use the datasource to populate gridviews, etc. But I want to know how I can programmatically populate a dataset by querying an Access database. How do I make queries to an Access database programmatically?
View 8 Replies
May 7, 2010
We have an ASP.NET application that uses SQL statements, where table names are unqualified. When compiled, it works fine, but when uncompiled, it complains and errors out, saying these tables dont' exist. (Qualified name looks like Select * from MyDatabase.mySchema.MyTable; Unqualified like Select * from MyTable) If you try these queries on the database, by yourself, it will take only the qualified names. What's going on? I thought Compiled vs Uncompiled apps should perform the same way codewise.
View 2 Replies
Mar 29, 2010
How to add queries in to database using ajax (without page refresh).
View 1 Replies
Nov 9, 2010
A sample linq query from MSDN: var expensiveInStockProducts = from p in products where p.UnitsInStock > 0 && p.UnitPrice > 3.00M select p; Does this query select EVERY column from the database table immediately, or does it return some sort of pointer that retieves the actual column data on demand? ie. If there are 50 columns in my table and I only use a single p.UnitsInStock in my actual code, then am I retrieving 50 times more data than I expected?
View 2 Replies
Aug 24, 2010
We have a web application using VS 2008, c#. We try to filter siteMap nodes based on security roles. We have our customized the mether GetRolesForUser() in RoleProvider class to determine a user's role. In this method, roles will be returned by querying an SQL Server database. However, we found that each time a page was loaded/refershed, this GetRolesForUser() was called, and the database would be queried. This is too MUCH and expensive. We thought the roles should be queried only once when a user logs in. After that, role info should be stored somewhere for this user, rather than query DB all the time.
View 3 Replies
Sep 2, 2010
anyone know that can we used select statement to called queries table in database or not?usually people used select statement to called common table in database.
View 4 Replies
Jul 22, 2010
I am very new on the C# and ASP scene and am after some advice on how to handle a senario. I have a asp website with 10 text boxes. These boxes form the basis of a user completed parameter selection. There is a button that will fire the query. The compliction is that some of the textboxes may be left blank and any combination may be filled in.
The only way i could think to do this is with countless IF statements. The user clicks the button and the process checks out the senarios and runs the corresponding SQL statement. The problem with this is that there are a vast amount of possible senarios depending on whether the user completes one box, all boxes, or a mix of any of them. The SQL query is the same for each senario bar the WHERE statement which changes depending on which text boxes are filled in. Is there another way of doing this or do i really need to write every possible senario out in full?
View 14 Replies
Feb 5, 2010
In general terms, which way will require more server processing power and which way will return faster queries... if there is even a difference. The client's database is still on the dev MS SQL server but is essentially but the client has decided they want to collect two more fields of information. Both fields are going to be collection text data and probably varchar(300) will be sufficient for the column data types. Would it ultimately be more efficient to
Add two additional columns in the main table so the data is entered directly into each record, or Add an additional table (or two) with a foriegn key to the primary table that holds the info for each new field The SELECT statement for the main table could be modified to either add the new columns (a.NewColumn1 and a.NewColumn2) or it could contain nested SELECT statements that pull in the data from the other tables. Custom daisy-chained Insert or Update statements would be no problem and a cascade Delete relationship would take care of any deletions. I'm just trying to figure out which would be better from a performance standpoint?
View 3 Replies
Jan 17, 2011
Website (ASP.NET/C#) hosted at a dedicated hosting company (location 1) Company database (SQL Server) with records of relevant data (location 2). Location 1 & 2 connected through VPN. Customer visiting the website and wanting to pull data from the company database. No possibility of changing the server locations or layout (i.e. moving the website to an in-office server isn't possible).
What I want to do is figure out the best way to handle the data acces in this case, minimizing the need for time-expensive database calls over the VPN.
When a user enters the section of the website needing the DB data, you pull all the needed tables from the database into a in-memory dataset. All subsequent views/updates to the data is done on this dataset. When the user leaves (logout, session timeout, browser closed etc) the dataset gets sent to the SQL server.
If two web visitors are performing updates on the same data, the one finishing up last will have their changes overwriting the first ones. There's also no way of knowing you have the latest data (i.e. if a customer pulls som info on their projects and we update this info while they are viewing them, they won't see these changes PLUS the above overwriting issue will arise).
View 2 Replies
Nov 27, 2010
I have a mailing system set up that repeatedly sends news to registered users on my website. However, sometimes the e-mail doesn't arrive, for various reasons (like a full inbox, closed mail account, etc). I noticed that mails to these invalid receivers are being sent repeatedly, until they finally arrive or timeout.
I was wondering if there is any way to prevent this, like an attribute in the MailMessage or SmtpClient classes? I don't want to needlessly strain the mailserver, as it is shared with other websites, so these mails should be send just once, on the first attempt, whether they arrive or not.
View 1 Replies
Jan 4, 2010
I have to display the contacts in gridview.I'm using objectdatasource. I have given the select method of objdatasource below:
Code:
Imports Microsoft.VisualBasic
Imports system.Data
Imports System.Data.SqlClient
Imports System.Collections
Imports System.Collections.Generic
Public Class Contactmanager
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("localConnectionString").ToString)......
View 5 Replies
Jun 7, 2010
I have a music related ASP.NET web site which caches a lot of static information from the database on the first request.Sometimes, the application is reset and cache is cleared while the application is on heavy load and then all http requests go to the database to retrieve that static data and cache it for other requests.
How can I ensure that only one request go to the database and cache the results, so that other request simply read that info from cache and not needlessly retrieve the same info over and over again.Can I use thread locking? For example, can I do something like lock(this) { db access here }?
View 2 Replies
Oct 22, 2010
Tell me how can i avoid reconnection to database while paging in repeater?
View 1 Replies
Aug 9, 2010
I am currently using the brinkster hosting (Pro Package) but recently they change my hosting to the new one and after that I got an error for sometimes and my session also expired very fast. Below is the feedback from Brinkster.
Thank you for letting us know about your recent experience with your application. From what we are able to find regarding your application problems, they appear to be related to your ms access database. Due to limitations of ms access, you may want to consider updating the database running your website to mysql. A Mysql database is available to your account at no additional charge.
MS access begins to experience issues like database locks (which is what appears to be happening to your application) when there are more than 3 or 4 concurrent connections to the database for reads. MS access is also only able to have one write connection open at any given moment. MS access databases are more susceptible to corruption and data loss than database application built for large application use and Enterprise or corporate use.
When you were hosted on the previous server, your IIS application pool was getting reset many times per day. This action was in effect unlocking your ms access database from its locked state. After we moved you to the new system and raised your memory utilization limit, your application does not receive resets more than one or two times a week. I have lowered your memory utilization from 200 to 100 in an effort to have your application reset more often, unlocking your database if it has began to cause issues.
My question is, do i have a choice to avoid change my database from MS Access to MySQL? Is MS Access database really have such problem as they mension or somethingelse happen on their server?
View 7 Replies
May 26, 2010
To Start with, I am new to .NET. So I am not refer to the right word, but I'll write up whatever I can.
Basically I have 3 input fields and then a search field.
When I hit the Search field, based on the 3 inputs, it needs to get the DataSet and fill it in the ListView.
I believe it is doing it. But when I added the DataPager, it lists only the first 10 rows, even if hit NEXT
Here is the code ib the .aspx page to populate the ListView
asp:ListView
ID="FISIItemsList"
ItemPlaceHolderID="ListFISIItems"
Since the NEXT button is not working, I thought of Adding the DataSet to a Properties. The and getting it back.So I did something like
public
DataSet
dsFISIItems[code]....
Even this doesn't work.
In simple terms, > After the 3 input fields are filled out, when a "Search" Button is hit, it should go and pick the list of items based on that criteria
> The result dataset needs to be binded to the ListView
> Next, the DataPager control should be paging. But it is not paging.
When I hit the next, it lists only the first 10 items repeatedly.
View 1 Replies
Oct 1, 2010
Suppose we want to select the data from the database then we write the query for that. Example:
SqlConnection con=new SqlConnection(Connetion name) string selectPkId = @"SELECT PK_ID FROM TABLE" SqlCommand cmd=new SqlCommand(selectPkId ,con);
So,my question is that why we basically use @ before the sql query.If I don't use @ before that then it again work fine (does not give any error), then what is need of using "@"?
View 1 Replies
Feb 8, 2011
I have a CLR 4 WCF service hosted in IIS 7.5 (Windows Server 2008 R2), using the WebHttp binding (with [WebGet]). The service calls into an unmanaged component implemented in C++ (Visual Studio 2010). I deliberately added an access violation inside the unmanaged component (by calling delete on a pointer repeatedly, calling methods through a deleted pointer, etc.) to test dump file generation settings. The access violation crashes the w3wp.exe process, which is not surprising considering "Corrupted State Exceptions" in CLR 4. However, when the process restarts (due to warmup and always-on settings in IIS), the same request seems to be replayed to the service so that it crashes the w3wp.exe process again. After a few times (governed by the "max failures" application pool setting) the application pool is stopped.
I'm using the browser as the test client, and while the restart sequence is underway the request is still in flight. When the application pool is stopped, the request returns with 503 Service Unavailable. I can work around the problem by placing try...catch block around the code and using the [HandleProcessCorruptedStateExceptions] attribute. When I do that, the w3wp.exe process does not crash. However, this is not the desired behavior -- I want the process to crash (an access violation or a memory corruption is bad enough) but I want it to restart into a clean state and not have the request replayed. I was not able to reproduce the problem using the BasicHttp binding.
View 1 Replies
Oct 16, 2010
Over the past two weeks or so, I've been getting feedback from users on my site that a popup box is interferring with their use of my search page. From the research I've done, it appears only Firefox users are having this problem. I haven't changed my site, so I can't figure out why this is happening. Has anyone successfully corrected this problem. It's costing me traffic, so I have to figure this out. My site is based on the classified starterkit.
View 4 Replies
Oct 7, 2010
We are running sql server 2000 with reporting services version 8.00.743.00. Yes, I know it's old, but it works. Anyway it worked up until a week ago. Now when you try to render a report on IE 7 or 8 or Firefox, the windows authentication appears multiple times. The report continues to render fine in IE 6.
View 2 Replies
May 30, 2010
I've added a database to one of my projects and I'm wondering how I can get intellisense for them.
Basically I have no how I can query the database that I've added to the project. I know SQL fairly well, but I don't know how I can write queries within vb.net and have them display.
I can get, so intellisense will probably be invaluable.
View 4 Replies