Need practical advice on using single stored procedure to process data adapter commands

dotnet framework

    Next

  • 1. Search results
    Hi I am using SqlServer 2005 database in VC++ (via ADO.NET). I am using stored procedure to search the database as SELECT supplierID, sampleID FROM Supplier JOIN Sample ON Supplier.supplierID = Sample.supplierID Now the problem is how to store these search results so that these can be used in VC++ interface using ADO. NET. Does it return DataRowCollection object? Thanks Manjree
  • 2. do release builds have the same amount of info in exceptions? e.g. will exceptions cought in release builds contain stack trace etc.?
    do release builds have the same amount of info in exceptions? e.g. will exceptions cought in release builds contain stack trace etc.?
  • 3. SET NO_BROWSETABLE ON ?
    I've noticed in my .NET application (with ADO) that whenever a query is done to SQL Server, a query executing SET NO_BROWSETABLE ON is done before. This has an huge impact on performance, as the round-trip to the server takes the same time as the correct query. I believe that if "SET NO_BROWSETABLE ON" wasn't executed, performance would almost double and network traffic would be reduced. I've tried to find a reasonable answer on the net for this, but haven't managed. Has someone noticed this and knows how to correct it? rj

Need practical advice on using single stored procedure to process data adapter commands

Postby 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

Postby 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

Postby 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



Return to dotnet framework

 

Who is online

Users browsing this forum: No registered users and 87 guest