Need practical advice on using single stored procedure to process data adapter commands
by njustus » Tue, 13 Jan 2004 01:30:12 GMT
Im trying to minimize the number of stored procedures and was
wondering if there is any downside to using a single stored procedure
to handle the select,insert,update, and delete commands for a data
adapter.
I create the sql dataadapter using system tables to generate the
parameters and add an additional parameter to denote the type of
process.
Would appreciate any experienced criticisms.....thanks
Re: Need practical advice on using single stored procedure to process data adapter commands
by Hermit Dave » Tue, 13 Jan 2004 01:38:57 GMT
insert would potentially need all the data.... (would have to generate a
primary key)
update would potentially need some day with the primary key value...
delete would just require the primary key value
now you can write code where you check for nulls and use a bigger stored
procs with if statements trying to process whether the request is
insert update or delete..
but if you have a problem if might be harder to sort out.....
plus y send extra parameters the K.I.S.S. methodology always pays with good
performance... you have to write lot more code but it performs better and
can be debugged in a better way.
HTH
--
Regards,
HD
Re: Need practical advice on using single stored procedure to process data adapter commands
by Kathleen Dollard » Wed, 14 Jan 2004 01:13:19 GMT
Noel,
If you're just trying to reduce the code you write, you might want to look
into generating your stored procedures.
Is there anything else you want to gain by "minimizing the number of stored
procs"
--
Kathleen Dollard
Microsoft MVP
Author "Code Generation in Microsoft .NET"
Similar Threads:
1.Passing parameter for Stored Procedure to Data Adapter/Data Se
2.Passing parameter for Stored Procedure to Data Adapter/Data Set
Hey all,
I'm trying to pass a parameter into my Stored procedure to be accessed by
my data adapter into a dataset
db2.AddParameter("@intClientID",
cmbClientList.SelectedValue.ToString());
DataSet rsDataset = db2.Fill("spListMappingDetails",
CommandType.StoredProcedure);
However, when i try to run it, it gives me an error
{"Procedure 'spListMappingDetails' expects parameter '@intClientId', which
was not supplied."}
Any help is appreciated.
I used a executescalar and executequery function and it has no problem.
thanks in advance
3.Table Adapter Configuration Wizard replaces data table name with stored procedure's
Hi
When using Table Adapter Configuration Wizard if 'Use SQL Statements' is
selected as Command Type, the data table's name in dataset is retained and
only its data adapter's select statements are replaced. If however 'Create
new stored procedures' is selected as Command Type, the data table name in
replaced by the name of the newly created select stored procedure. Problem
with this is that the data table's name needs to be put back manually.
Is there a way to keep the data table name the same and just stored
procedures are assigned to the data table's data adapter?
Thanks
Regards
4.Assign new stored procedure to data adapter
Hi NG,
can I assign another stored procedure as select statement to a data adapter
during runtime ?
thanxx for answer
P@rick
5.Customizing stored procedure generated by data adapter wizard.
Is it possible to customize the stored procedures that are generated by the
Data Adapter wizard? I do not mean afterwards but I would like to customize
the template (if any) that the Data Adapter Wizard uses to generate this
code.
Thanks,
Patrick
6. Advice needed : stored procedures or datasets?
7. use existing stored procedure in data adapter configuration wizard is disabled
8. Stored procedure to transfer the data of one row to a single column