473,326 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

least resource hungry method of updating to a sql database?

Hi, i'm using a sqldatareader to display information in textboxes, now i need the best 'resource saving' method to save the information held in these textboxes back to the database.. i know there are alot of different methods, but i need to know the best one in terms of keeping our server from exploding (vb.net 2005)


thanks
Dec 5 '07 #1
4 1230
Airslash
221 100+
Hi, i'm using a sqldatareader to display information in textboxes, now i need the best 'resource saving' method to save the information held in these textboxes back to the database.. i know there are alot of different methods, but i need to know the best one in terms of keeping our server from exploding (vb.net 2005)


thanks
I'd remove the textboxes, and start by using a datgrid. You can then place datasets and datatables behind it for datasource binding. This would allow you to set select, delete and update statements on your components and just have one component for every statement you wish to perform.

I myself, use a datagridview with a sqldatareader. I read the values from the database, place them inside the datagridview, and allow them to be manipulated. By utilising hidden fields, I manually keep track of which rows are to be deleted / updated / inserted and then I use my own custom class to perform those actions.

If you want a precompiled class, you might wish to look into the Microsoft Application Blocks. Its a free download for database connections in the .net environment.

I personally wrote a class thats some sort of upgrade of the datablocks, because they're .net 1.0, while my class is 3.0
Dec 5 '07 #2
kenobewan
4,871 Expert 4TB
Good reply Airslash, but the question was mainly concerned with performance. Use executenonquery, stored procedures & optimize their performance, optimize sql server, don't try to squeeze everything into one query. Here is an article that might help:
Don't use stored procedures yet? Must be suffering from NIHS (Not Invented Here Syndrome)
Dec 5 '07 #3
Airslash
221 100+
Good reply Airslash, but the question was mainly concerned with performance. Use executenonquery, stored procedures & optimize their performance, optimize sql server, don't try to squeeze everything into one query. Here is an article that might help:
Don't use stored procedures yet? Must be suffering from NIHS (Not Invented Here Syndrome)
Sorry for hijacking this topic then, but your blog has brought up a question that sort of relates to this regarding performance.

Say I have a Person object declared with several fields. And to fill those fields I would require information from the database. (hence my entire app works like this), would you then stick to stored procedures, or SqlDataReaders in a case like this ?

Personally Im in favour of views + readers, but posted in the blog, if the database design changes, or design of the information flow, then I need to change my sql codes. But I don't really understand/see how a stored procedure can return the information I need.
Dec 5 '07 #4
kenobewan
4,871 Expert 4TB
It really depends on the size of your site, but what I suggesting is given number of queries, security and other considerations stored procedures are not the slow and lesser choice especially for a corporate site. Some developers spend alot of time optimizing their code and do not take advantage of things like data caching. The way that you use stored procedures is important and one thing I would not get too hung up on is their performance.
Dec 6 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: lawrence | last post by:
I had some code that worked fine for several weeks, and then yesterday it stopped working. I'm not sure what I did. Nor can I make out why it isn't working. I'm running a query that should return 3...
5
by: lawrence | last post by:
I posted before, but have now narrowed my problem down to this method. At the start of the method, I test to make sure that I have a resource, a pointer to data returned from a database. This test...
6
by: Grandpa Pete | last post by:
How can I share resources across all users of a web service for read/write access. *Situation* *one*: I want to have an in memory counter that all users of the webservice could access. Call...
5
by: John Perks and Sarah Mount | last post by:
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close()
6
by: Klaatu | last post by:
I've seen plenty of examples of updating a resource using UpdateResource(). Has anyone actually used it to add a new resource? For example, a menu resource. If so, how is it done? I'm not quit...
5
by: Martin Bischoff | last post by:
Hi, is it possible to implement custom resource managers for ASP.NET 2.0 so that strings can be read from a database (for example)? Ideally, it should be possible to configure the custom...
1
by: richard.hallgren | last post by:
Hi, I have a static method that I use for data access. This particular method reads x number of rows and then updates these rows with a read = 1 flag. I access this method with several threads...
1
by: Max2006 | last post by:
Hi, I am truing to find a pattern for my Business Logic Layer to be able to work fine win ObjectDataSource's Update method. The challenge is ObjectDataSource is not able to work with an...
0
by: pieandpeas | last post by:
Hi, i'm using a sqldatareader to display information in textboxes, now i need the best 'resource saving' method to save the information held in these textboxes back to the database.. i know there are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.