473,837 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SqlDataSource TSQL vs Procs

I'm fairly new to ASP.Net 2.0 SQLDatasource objects. It defaults using TSQL
statments for the SELECT, INSERT, UPDATE, DELETE commands, which is great
and it works. However, I've always been taught that all SQL work should be
completed by the SQL server, therefore use stored procedures even for the
simplest of select statements. Does this still hold true for sqldatasources?
Should I use procs instead of the default tsql??

Thanks,

David Lozzi

Mar 16 '07 #1
8 1461


Whether or not you use
TSQL or "inline" sql, I would suggest you create a datalayer.

The SqlDataSource is NOT a datalayer.
The base argument is really:

Rapid Code Development VS Good Code Development.

Unless I'm whipping up a demo that needs to be done by yesterday,
I would avoid tags (of which SqlDataSource is one ) 99.9% of the time.

Rapid <Good most of the time.

Good development means it is maintainable (among other things), and the
<tagsapproach is cumbersome in that regard.
See
6/5/2006
Custom Objects and Tiered Development II // 2.0
http://sholliday.spaces.live.com/blog/

for what a datalayer object is ( among many others sites out there )

"David Lozzi" <dl****@nospam. nospamwrote in message
news:08******** *************** ***********@mic rosoft.com...
I'm fairly new to ASP.Net 2.0 SQLDatasource objects. It defaults using
TSQL
statments for the SELECT, INSERT, UPDATE, DELETE commands, which is great
and it works. However, I've always been taught that all SQL work should be
completed by the SQL server, therefore use stored procedures even for the
simplest of select statements. Does this still hold true for
sqldatasources?
Should I use procs instead of the default tsql??

Thanks,

David Lozzi

Mar 16 '07 #2
"sloan" <sl***@ipass.ne twrote in message
news:Oz******** ********@TK2MSF TNGP05.phx.gbl. ..
Rapid Code Development VS Good Code Development.

Unless I'm whipping up a demo that needs to be done by yesterday,
I would avoid tags (of which SqlDataSource is one ) 99.9% of the time.

Rapid <Good most of the time.
I couldn't agree more!

In fact, once I've added my DAL to a new project, it's actually quicker and
easier to use that rather than any of the new data objects...
Mar 16 '07 #3

Yeah, once you get used to doing good DataLayer objects, its at least as
fast or not faster than the gui/wizards.

And for maintenance, you can't ever compare.

SqlDataSource ........ youch, its the most non maintable thing I've ever
seen.

"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:uN******** ********@TK2MSF TNGP03.phx.gbl. ..
"sloan" <sl***@ipass.ne twrote in message
news:Oz******** ********@TK2MSF TNGP05.phx.gbl. ..
Rapid Code Development VS Good Code Development.

Unless I'm whipping up a demo that needs to be done by yesterday,
I would avoid tags (of which SqlDataSource is one ) 99.9% of the time.

Rapid <Good most of the time.

I couldn't agree more!

In fact, once I've added my DAL to a new project, it's actually quicker
and
easier to use that rather than any of the new data objects...


Mar 16 '07 #4
"sloan" <sl***@ipass.ne twrote in message
news:%2******** **********@TK2M SFTNGP02.phx.gb l...
SqlDataSource ........ youch, its the most non maintable thing I've ever
seen.
LOL! When I first saw it back in the beta days, my first thought was the
Microsoft was trying to woo FrontPage users... :-)
Mar 16 '07 #5

This guy
http://www.code-magazine.com/Article...uickid=0605051
(Juval Lowry) I think coined it

"Microsoft' s no programmer left behind" program.

...
(at my Jan user group meeting)

"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:%2******** ************@TK 2MSFTNGP06.phx. gbl...
"sloan" <sl***@ipass.ne twrote in message
news:%2******** **********@TK2M SFTNGP02.phx.gb l...
SqlDataSource ........ youch, its the most non maintable thing I've
ever
seen.

LOL! When I first saw it back in the beta days, my first thought was the
Microsoft was trying to woo FrontPage users... :-)


Mar 16 '07 #6
"sloan" <sl***@ipass.ne twrote in message
news:u2******** ********@TK2MSF TNGP05.phx.gbl. ..
"Microsoft' s no programmer left behind" program.
LOL!
Mar 16 '07 #7
THANK YOU THANK YOU THANK YOU

I've been wondering about this for a long time and finally decided to ask.
I'm glad to see your converstations back and forth, I agree with you. I just
finished a project using DAL and decided to try to use the quick and easy
sqldatasource object.... and I'm glad I asked now, i'm only 3 pages into a
40 hour project, i'm sticking with my DAL.

THANKS AGAIN!!!

David Lozzi
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:Ou******** ********@TK2MSF TNGP04.phx.gbl. ..
"sloan" <sl***@ipass.ne twrote in message
news:u2******** ********@TK2MSF TNGP05.phx.gbl. ..
>"Microsoft' s no programmer left behind" program.

LOL!
Mar 16 '07 #8
OK, so an author and tech I highly respect from 4guysfromrolla. com lists the
benefits of using the tagged sqldatasource, as specified below. It is a lot
more work not to use the tagged method.....

http://aspnet.4guysfromrolla.com/articles/011106-1.aspx

Thanks,

David Lozzi.
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:Ou******** ********@TK2MSF TNGP04.phx.gbl. ..
"sloan" <sl***@ipass.ne twrote in message
news:u2******** ********@TK2MSF TNGP05.phx.gbl. ..
>"Microsoft' s no programmer left behind" program.

LOL!
Mar 22 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11948
by: Steve | last post by:
Hi; I have been writing a lot of short tsql scripts to fix a lot of tiny database issues. I was wondering if a could make an array of strings in tsql that I could process in a loop, something like array arrayListOfTablesToProcess = { "orders", "phone",
18
4635
by: mountain man | last post by:
Greetings to all database professionals and laymen, Let us make a bold assumption that we have developed a software tool for the SQL Server environment which simply acts as an interface between an end-user in an organization and the database, through the exclusive use of stored procedures which are authored by the organization or by software developers. All development work at the application software level may thereby be conducted...
2
18709
by: dynoweb | last post by:
I have several *.sql files with schema/data changes to be applied to our current database. Is there a way to create a TSQL script that could be run from the SQL Query Analyzer that would sequentially call the *.sql files? i.e. call schemaVersionCheck.sql call addFieldToLoanTable.sql call updateLoanTrigger.sql
5
4483
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a ControlParameter <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XYZ %>"
8
5047
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my select, remember it, and then use it in the update. It works just fine when I have full control of the whole process. I want to do the same for my GridView/SqlDataSource combinations. I typically select from a view and update the corresponding...
2
1193
by: cognizance42 | last post by:
Hey gang, I'm in the process of fixing an application a former programmer slap together. We found the database design went against company standards, so our DBA went through to fix her up. Now I'm working on the task of fixing the UI code to interact properly with the new changes. However, I've ran in to a strange behavior with UpdateParameters within my SqlDataSource.
3
2500
by: Jesse Liberty | last post by:
I created a new database (tried both in 2005 and in SQL 2000) and then created a SqlDataSource control in an asp.net application. Clicked on the smart tag and whose configure data source. When I click Advanced should see the Generate Insert, Update and Delete statements check box but it is grayed out. Any idea what might cause this? I can work around with this code, which does work: SqlDataSource1.InsertCommand = "Insert into myTable...
3
6417
by: Jim Andersen | last post by:
Just to let you know, and to help any future sorry sods who gets trapped in the same black hole...... You can't just copy/move a working sql-statement into a stored procedure. Working with a sqldatasource. Conflictdetection set to compareallvalues. Oldvaluesparameterformatstring set to original_{0} tblA has 2 fields. ID and MyText. Deletecommand="Delete from tblA where ID=@original_ID"
2
1999
by: djc | last post by:
1) I am wondering if I should be using an sqlDataSource object for my particular scenario. I need to loop through a listbox and perform an INSERT sql operation for each item. Could be a few or several items. The reason I'm wondering if I should use an SqlDataSource object is overhead. For example, prior to learning about the sqlDataSource I would just code the ado.net procedure myself. For example, create connection object, create and...
0
9851
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10639
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10286
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7824
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7012
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5680
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3128
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.