|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
edit single record in formviewi want to return a selected record through output parameters in a stored proc
and bind them to a formview; is this possible and how should it be done? currently i'm using a stored proced that essentially returns a set of data containing only one row for the selected record. it is my understanding that this is ineffecient as compared to using output parameters for single record selection. thanks. No, it's probably more efficient to return back a single record than having
to keep track of multiple output parameters from a stored procedure. -- Show quoteHide quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "Phil" <P***@discussions.microsoft.com> wrote in message news:A1D11741-0636-4F1A-B617-2805D07B7D37@microsoft.com... >i want to return a selected record through output parameters in a stored >proc > and bind them to a formview; is this possible and how should it be done? > currently i'm using a stored proced that essentially returns a set of data > containing only one row for the selected record. it is my understanding > that > this is ineffecient as compared to using output parameters for single > record > selection. > > thanks. Sorry, I was using "effeciency" to describe the resources used on the server
and/or client. Using output parameters to return a single record has be the norm since vb 6.0/ASP 1.0/SQL Server 6.5 when ADO was first introduced (perhaps before, but that is when I became aware of it). It means less resources are used by the server building a "record/data set object" to pass back to the client, and less resources are used on the client maintaining this object. Using output parameters is always faster and uses less overhead than executing and return a full result set. For the developer, imho, coding to output parameters is not much more work than coding to a result set object (ie dataset/datareader), but perhaps that's just been the case in my scenarios and yours have been different. At any rate, thanks for the reply. Perhaps this is a question that can be reposted in the correct forum if it needs further investigation, as I'm still needing an answer to my databinding question. Thanks, Phil Show quoteHide quote "Christopher Reed" wrote: > No, it's probably more efficient to return back a single record than having > to keep track of multiple output parameters from a stored procedure. > -- > Christopher A. Reed > "The oxen are slow, but the earth is patient." > > "Phil" <P***@discussions.microsoft.com> wrote in message > news:A1D11741-0636-4F1A-B617-2805D07B7D37@microsoft.com... > >i want to return a selected record through output parameters in a stored > >proc > > and bind them to a formview; is this possible and how should it be done? > > currently i'm using a stored proced that essentially returns a set of data > > containing only one row for the selected record. it is my understanding > > that > > this is ineffecient as compared to using output parameters for single > > record > > selection. > > > > thanks. > > > Well, regardless of the past, the problem with output parameters is that you
will need to do more programming, not less, when using .NET. When the new design of ASP.NET 2.0, a FormView dovetails perfectly with SqlDataSource. Thus, the best way to use a SqlDataSource object is to create a SelectCommand that produces a "recordset" from your database. Even better, this can all be done in the ASPX page without any code to start. To use multiple output parameters (say 3 or more) will require a lot more coding on both the .NET side as well as within your stored procedure. Additionally, your stored procedure, if running a query, is already returning the data back as a cursor, unless you do more programming in the stored procedure to prevent. Look at some of the QuickStart Tutorials available at www.asp.net for FormView. This should help. -- Show quoteHide quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "Phil" <P***@discussions.microsoft.com> wrote in message news:A009AA1B-82B9-4183-A927-CB3F2A07B8BB@microsoft.com... > Sorry, I was using "effeciency" to describe the resources used on the > server > and/or client. Using output parameters to return a single record has be > the > norm since vb 6.0/ASP 1.0/SQL Server 6.5 when ADO was first introduced > (perhaps before, but that is when I became aware of it). It means less > resources are used by the server building a "record/data set object" to > pass > back to the client, and less resources are used on the client maintaining > this object. Using output parameters is always faster and uses less > overhead > than executing and return a full result set. > > For the developer, imho, coding to output parameters is not much more work > than coding to a result set object (ie dataset/datareader), but perhaps > that's just been the case in my scenarios and yours have been different. > > At any rate, thanks for the reply. Perhaps this is a question that can be > reposted in the correct forum if it needs further investigation, as I'm > still > needing an answer to my databinding question. > > Thanks, > Phil > > "Christopher Reed" wrote: > >> No, it's probably more efficient to return back a single record than >> having >> to keep track of multiple output parameters from a stored procedure. >> -- >> Christopher A. Reed >> "The oxen are slow, but the earth is patient." >> >> "Phil" <P***@discussions.microsoft.com> wrote in message >> news:A1D11741-0636-4F1A-B617-2805D07B7D37@microsoft.com... >> >i want to return a selected record through output parameters in a stored >> >proc >> > and bind them to a formview; is this possible and how should it be >> > done? >> > currently i'm using a stored proced that essentially returns a set of >> > data >> > containing only one row for the selected record. it is my >> > understanding >> > that >> > this is ineffecient as compared to using output parameters for single >> > record >> > selection. >> > >> > thanks. >> >> >>
Itemtemplace and many to one dropdown example wanted
SelectedValue which is invalid Read underlying data in GridView row? Error: Multiple controls with the same ID '1' were found. Extracting values from child controls of a Repeater Format telephone number?? Can't Create a multi page report Customise the SiteMapPath Control or use wild card URLs with a custom SiteMapProvider Force multi line field value to output with line breaks? RE: detailsview, |
|||||||||||||||||||||||