Click here to Skip to main content
15,900,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai

I have some data base tables and am retrieving tables data individually.
am using data set and data tables.and using sql command object and have parameters.same code is repeating each time how to use a single function?please help me

Regards
Nijil
Posted

Its simple. Move all the code that is used again and again into a common location.
IF it uses certain values that change everytime you run this code, move them into parameters and pass them via the call.
 
Share this answer
 
I'm guessing you're talking a out the code that instantiates the db, adds the parameters and executes the SQL?
If you use th MS application blocks it can shorten it a bit, but if your adding different param values to parameters with different names, then your stuck without using some sort of ORM.
post a code sample - we can offer better advice if we can see the problem
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900