Why use parts of Ado.net when you can use SQL

Just on this line of thought. Why use objects such as DataTable,DataRow,DataColumn when you can use SQL to select and insert data more effectively. 

I have been creating applications that use sql queries and stored procedures.
The other way to do it would be to use ADO.nets objects that help you like DataTable,DataRow, DataColumn. I hardly ever use them at all so are they really worth going into in depth. I prefer SQL to do all my data manipulation.
MCAD.Net vb.net
0
midi25
9/2/2003 3:04:44 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

12 Replies
1227 Views

Similar Articles

[PageSpeed] 50

Perhaps you should explain how you use sql queries and stored procedures and how you think they're more effective.
0
russnem
9/2/2003 4:12:24 PM
I find it much easier to manipulate the data in a db using Sql queires and executing them rather than loading data into a dataset manipulaiting it and the pushing it back to the datasourse.
MCAD.Net vb.net
0
midi25
9/2/2003 4:38:02 PM
Can you give us some code? I still don't follow you. We all use queries or stored procedures, and what I don't get is how you're relating them to datasets, datatables, dataviews, etc. in your particular circumstances.
0
russnem
9/2/2003 5:48:51 PM
I guess that he is talking about the data adapters .... (data adapter & datasets vs commands or just plain sql)...

No?
Christian Calderon
Need to work in Classic ASP? then do it the right way with CLASP!
Classic ASP Framework
0
ccalderon
9/2/2003 6:28:50 PM
Correct. 

DataApapters and Datasets vs Command & Sql
MCAD.Net vb.net
0
midi25
9/2/2003 8:47:31 PM
Well it all depends on what your specific need is. Obviously you don't use what you don't need. For example you wouldn't create a whole DataSet to bind to a control when all you need is a SqlDataReader.
0
russnem
9/2/2003 9:38:22 PM
Perhaps below link could give you little bit biggning for your thoughts on Dataset/reader etc!!

http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconoverviewofadonet.asp
Sreedhar
http://www.w3coder.org
weblog http://weblogs.asp.net/skoganti
0
sreedhark
9/2/2003 11:31:47 PM
I almost had to wonder when I saw this subject line--has someone created another data access framework for ASP.NET? One that sends queries "straight" to the database without all those "nasty layers" in between?

On skimming it, I see that the real issue isn't ADO, but rather, how much of ADO to use.
This is another one of those questions where I think that the answer is impossible to arrive at until you first define who is going to pay for lunch.
Huh? what does paying for lunch have to do with it? Everything. What I mean is this--almost everything you put into an application is a tradeoff in one way for another. Everything comes at a price--including lunch--and the choice isn't whether or not to "pay the price", but rather, WHERE to pay it.
In this case the issue seems to be, err, umm,,, hmmm... on re-reading it, I still can't figure out just what IS the question. It would seem that someone is concerned that all that Dataset/dataadapter/datareader stuff is too much .... errr... well, again, I can't really tell what they think it is too much of.
But I can tell you one thing all that stuff represents and that is one way of paying for lunch. And quite an elegant way, at that. A way that lets us spread the cost of some things to more appropriate places depending on our application's needs.
Oh, BTW, in this case, the 'lunch' IS the SQL we write to manipulate the database. ADO gives us some really nice choices--do we go the super, dooper econo route--make everything from scratch, spend all day over the hot stove? Or do we save on some areas so that we can focus more on the menu and on enjoying it when it's done? (faster development, fewer buts, easier to maintain, etc...)
But I'm still curious. Has our poster found a way to go straight to the database from a line of code without using anything else? Just write a stored procedure, and then refer to the columns it returns in the app, and leave it to Scotty to beam up the data when it's needed?

Jim


MS MVP ASP.NET [VC++/MFC emeritus]


Old Dog Learns New Tricks

Preferred programming language: cuneiform on clay tablets
0
JimRoss
9/2/2003 11:49:09 PM
Well said Jim,

Personally I like the elegance of the dataadapter/dataset model. I guess some people are just more comfortable working at the plumbing level though. I prefer to leave that to the 'experts' and give myself more time on the Bus Logic and things like performance and security.
Jon.
Jon Cox

Developer VB, C++, Java, Delphi, C#

MCP
0
joncox77
9/3/2003 10:48:55 AM
I think that the guy is just saying that to have to write all those commands in a adapter and then calling is not necesarily better than to write a parametrized query using a command object, etc...  or something like that.

It really depends on your coding style I guess... I personally use datareaders for searches (read only views of data) and either custom business entities or datasets when updating or moving stuff around for updating or some other operations.
If it is a small application don't even bother with those questions, its a waste of time & money. Use the simplest way possible.
Christian Calderon
Need to work in Classic ASP? then do it the right way with CLASP!
Classic ASP Framework
0
ccalderon
9/3/2003 1:53:40 PM
If it is a small application don't even bother with those questions, its a waste of time & money. Use the simplest way possible. 

Good point. But when it is not a small application, that's when things aren't so simple. Then you have all kinds of things to balance -- simplicity (often not an option as an app gets more complex), efficiency, ease of maintenance, etc. Usually you have to end up sacrificing one or more of these to gain another one, and "simplicity" is generally the first virgin to be sacrificed to the "requirements" god.

Jim


MS MVP ASP.NET [VC++/MFC emeritus]


Old Dog Learns New Tricks

Preferred programming language: cuneiform on clay tablets
0
JimRoss
9/4/2003 12:40:11 PM
hehe, nice way of explaining it Jim :-)  . I agree with what you said. Long time ago I learned that there is no such thing as a free lunch.  What I tried to say by simple is that for instance , you know that your app. will run in an intranet and will only have 50 potential users out of which only about 5 will be connected simultaeously, then the project should even be fun to code!!!, you should not waste time trying to design a super app... just keep it simple. Every question has a "it depends" answer... because when you design an app you have to take into consideration different variables such as time, cost, environment, etc...


I think that what is more important is that you know and understand what your options are and the sacrifices that you will have make (i.e. performance vs maintenance, etc) while designing your application. I think that sometimes people try to design the perfect solution and while doing that they start lose focus in what is important. There are plenty of examples on how to do the things the right way out there, a full menu of options, just follow the approach you like to most, and even more, create your new dishes...
Christian Calderon
Need to work in Classic ASP? then do it the right way with CLASP!
Classic ASP Framework
0
ccalderon
9/4/2003 1:58:19 PM
Reply:

Similar Artilces:

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

can not add a record to a db table using the vb.net and ado.net
Hi   I am trying to insert record to Pups Database using ado.net and vb.net in a windows application. This form will collect data from user to insert it into stores table at Pubs database (storeID, name, address etc..). I am not able to get the new inserted record into the stores table here is my coude behind for the formImports System.Data.SqlClient  Public Class ParametersExample Inherits System.Windows.Forms.FormDim con As SqlConnection  Private Sub addBttn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles addBttn.Click Dim cmd As SqlCommand = ...

How to get new web app to use .NET 2.0 on Win2K server using .NET 1.1 as default framework?
I have .net framework1.1 and 2.0 on our server running win2K. i have existing applications that uses asp.net 1.1, i also have a new app that use ASP.net 2.0.  how can i set my new .NET 2.0 app to point to asp.net 2.0 without messing up my existing .NET 1.1 apps? To specify the ASP .Net version fro a web application, do the followingIn IIS Manager select the web application -> Properties -> ASP.Net TabSelect  ASP.Net version you want to use for the applicationRegards,PrashantDont forget to click "Mark as Answer" on the post that helped you. But I am running Win2K...

How to use net use?
Please can any one tell me how to use the dos command net use properly? I have read the help but can't seem to get it to work. Keep getting sytax error message. Thanks in advance. "Beowulf" <who-knows@no-one.com> wrote in message news:9krutk$puu$1@news.grc.com... > Please can any one tell me how to use the dos command net use properly? > > I have read the help but can't seem to get it to work. Keep getting sytax > error message. what are you trying to do? There are about 50 options to "net use" that do a ton of different thin...

How to call or retrieve fields from sql and display in table without using ADO.net, I'm using a dynamic link library....Is the coding different?
Help me! I'm doing my school project on Software Change Management Tool, CR Tracker. I want to display table in the webform, and the table data is retrieve form the sql server. So how do I call the sql so as to display the data in a table? hy..What does that dll contain ?Does it already contains relevant code to connect to a database ? Have a look hereThanksDinuj Nath The easy way to do this is with the use of a data bound grid. The Grid can be customised to look and feel you like. You will need to add a data adapter to your page and a grid. When you setup the data adapter you will nee...

HOW CAN I USE ADO.NET?
 Hi,I can not use this cod: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="test.aspx.vb" Inherits="ICT2.WebForm1"%> <%@ Import Namespace="System.Data.SqlClient" %><script Runat="server"> sub page_LoadDim conPubs As sqlConnectionDim CmdSelectCount As SqlCommandconPubs=New SqlConnection("server=Localhost; UID=sa; PWD=secret; database=Pubs") ConPubs.Open()CmdSelectCount=New SqlCommand("Select Count ( * ) From Authors ", ConPubs) lblresults.Text= CmdSelectCount.ExecuteScalar( ...

Insert datetime, using ADO.net VB.net
Hello there,I got a little code there are inserting a record into my msSQL database..But i cant insert the datetime, for one reason?The problem is in line 7 () where i want to insert DateTime.Now 1 Protected Sub SendPmTilAfviste(ByVal modtager As String, ByVal festID As String) 2 ' Connection 3 Dim conn As SqlConnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True") 4 conn.Open() 5 6 ' SQL-kommandoen 7 Dim cm...

Help! Can anybody tell me if I can use Visual Studio.NET to develop Web application at my home using Windows XP Home Edition?
Can anybody tell me if I can use Visual Studio.NET to develop Web application at my home using Windows XP Home Edition? I downloaded Web Martrix. But I don't want to use its IDE. I just want to use its webserver because Home Edition can't have IIS. Thanks.HeiGe Visual Studio.NET neededs IIS, But in home addition you can't use IIS. So in XPHome you can't use Visual Studio.NET from ASP.NET development!Sreedharhttp://www.w3coder.orgweblog http://weblogs.asp.net/skoganti Thanks for your answer. But I have successfully added IIS to my XP Home. Special thanks to Holeinone, Pippo a...

Using Dot Net Nuke to maintain a site developed in VS.NET using C#
Hi,Does anyone know if there is a way to create a site using C# and Visual Studio.NET 2003, but then use Dot Net Nuke to allow non-technical users to add content to the site.  The current state of the site must be accessible in both VS.NET and DNN regardless of which application saved it last.  Also preferably I would like the language used to remain C# even when edited by the marketing staff, so that I can still maintain it myself using VS.NET.  Hope you understand what I mean. If this is not possible, I wonder if anyone knows what solution I am after.   Thanks in adv...

Can I use nested cursor by ado.net?
Can I use nested cursor by ado.net? If so, there are database error. error message as follows: System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first. at Sybase.PowerBuilder.Db.Block.SqlBlock.ProcessError(Exception ee) at Sybase.PowerBuilder.Db.Data.DbBlock.Execute(String strCommand, CmdType type, Int32 iRst, Int32& iNumber, Object[]& datas) at Sybase.PowerBuilder.Db.DbRoutine.Execute(String strCommand, CmdType type, Int32 iRst, Int32& iNumber, Object[]& datas) How to do? Thanks. ...

How to use HTTP protocol in .Net Remoting? Thanks and Regards,How to use Http protocol in .net Remoting
<>Hi,     <><>How to use HTTP protocol in .Net Remoting ? Is there any specific code bits requires for that ?    I am using TCP protocol it's working but when i change it to  HTTP it throwing an error like "Arugument null exception"<>  Could  anybody give samples for that? Thanks & Regards,Vijay Here is an example of HTTP remoting:http://msdn2.microsoft.com/en-us/library/system.runtime.remoting.channels.http.httpchannel.aspxCheers,       Kev...

How benificial is it to use VS.NET? Can I do just as well with VB.NET?
How benificial is it to use VS.NET? Can I do just as well with VB.NET? I'm probably going to be moving from handcoding with HomeSite and ASP Classic to ASP.NET. From all I read VS.NET seems the tool of choice but expensive. Will VB.NET do just as well if all I plan to write is VB code? Any other good choices? Thanks As far as i know there is no Product" entitled vb.net. Visual Studio.Net 2002/2003 differs from it's non .net predesser (mental block, cant spell - sorry) in that all technologies (ie. VB, c# C++, J#) are developed from within the one application(IDE). There...

If I use javascript in my pages, can I still use ADO to connect to SQL server?
I'm not exactly sure what I'm doing here.  (I'm sure it shows)  I want to start using javascript and ajax in my ASP.net pages, but am currently using ADO (I think) to communicate with my SQL server.  Here's a sample script..   Dim objConn As New SqlConnection(ConfigurationSettings.AppSettings("DSN")) Dim objCmd As SqlCommand Dim objRdr As SqlDataReader  Sub LoadMenubar()  Try   objConn.Open()   objCmd = New SqlCommand("SELECT * FROM Menubar ORDER BY Priority", objConn) &...

used a c#.net to vb.net converter and am now getting a syntax error.
ok I used a cool utility at http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert some c#.net to vb.net and it spit out a bunch of code which almost works but I am getting a syntax error on this line Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) I tried it that way and also like Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) but either way gave the same error Compiler Error Message: BC30035: Syntax error. Source Error: Line 26: Line ...

Web resources about - Why use parts of Ado.net when you can use SQL - asp.net.getting-started

Federated Auto Parts 400 - Wikipedia, the free encyclopedia
The Federated Auto Parts 400 is an annual NASCAR Sprint Cup Series stock car race held at the Richmond International Raceway in Richmond, Virginia ...

Anthony Bourdain: Parts Unknowns Fotos - Anthony Bourdain: Parts Unknown - Facebook
“Tangier is Morocco. Always was Morocco. And recently the country’s leadership seems to have embraced it in all its ill-reputed glory. The days ...

Parts Unknown (@PartsUnknownCNN) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

App Store - Car Parts Game
Get Car Parts Game on the App Store. See screenshots and ratings, and read customer reviews.

Rebels in Jabal al-Zawiya area use motorbike parts to jerry-rig this heavy machine gun so they can operate ...
Rebels in Jabal al-Zawiya area use motorbike parts to jerry-rig this heavy machine gun so they can operate it manually. The rebels say a weapons ...

Sculptures from Spare Parts: Typewriter Assemblage - YouTube
Jeremy Mayer's typewriter assemblages are sculptural pieces made purely from typewriter parts. In a process he calls "reassemblage," Mayer fits ...

Winter around the corner: Parts of Ontario, Quebec hit with first wintry blast of the season - CTV News ...
Snow has already begun to fall on parts of Ontario and Quebec this weekend, with up to 20 centimetres of accumulation expected in what could ...

MillerCoors Parts Ways With VP-Brand Marketing Gannon Jones
MillerCoors has parted ways with VP-Brand Marketing Gannon Jones. Mr. Jones, who reports directly to Chief Marketing Officer David Kroll, joined ...

Winter Storm Bella to bring first snow of season to parts of the Midwest, including Chicago, Detroit ...
By weather.com Winter Storm Bella has been named by the winter storm naming committee at The Weather Channel. Bella is the second named winter ...

When is the best time to buy auto parts?
Filed under: Ownership , Auto Repair , Open Road Forget the Black Friday sales. A little planning and patience can get you high-quality parts ...

Resources last updated: 11/22/2015 3:58:54 AM