473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

passsing large number of parameters

Hello Everyone,

What will be the best way of passing large number of paramers from one
method to another so that I can insert them in the Database.

Thanks.
May 24 '07 #1
5 1824
Not sure how much is "large", but when I need to pass to a stored proc all
IDs user selected in a list, I usually construct a comma separated string and
pass it into a stored proc, and then split them inside the proc.

If you can provide more info, I will try to be more specific

"Vinki" wrote:
Hello Everyone,

What will be the best way of passing large number of paramers from one
method to another so that I can insert them in the Database.

Thanks.
May 24 '07 #2
Vinki <Vi***@discussions.microsoft.comwrote:
What will be the best way of passing large number of paramers from one
method to another so that I can insert them in the Database.
Encapsulate the parameters into a separate type - then there's just one
object to pass around, and it's a lot easier to understand parameters
when they're accessed by name via properties than positionally.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 24 '07 #3
If you mean inside of .Net (rather than .Net -SQL) I'd probably
define the data in an entity class... the meaning of everything is
clear and you only need pass one object (or an array of like-typed
objects) around.

Marc

May 24 '07 #4
Can you give me any example of encapsulating the parameters into a seperate
type.

Thanks.

"Jon Skeet [C# MVP]" wrote:
Vinki <Vi***@discussions.microsoft.comwrote:
What will be the best way of passing large number of paramers from one
method to another so that I can insert them in the Database.

Encapsulate the parameters into a separate type - then there's just one
object to pass around, and it's a lot easier to understand parameters
when they're accessed by name via properties than positionally.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jun 4 '07 #5
Vinki <Vi***@discussions.microsoft.comwrote:
Can you give me any example of encapsulating the parameters into a seperate
type.
See http://pobox.com/~skeet/csharp/miscu...ermanager.html
for an example from my own library.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jun 4 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
0
by: cschang | last post by:
Error: "ORA-06513: PL/SQL: index for PL/SQL table out of range for host language array ORA-06512: at line 1 /vd2/asp/BinInactivityResults.asp, line 249" the error only appeared when I had a large...
5
by: Oeleboele | last post by:
OK, I can't understand this exactly: I have this function: int howdy(void *) I first past this to the function &aCharArray I realized later that this should be aCharArray but... the former...
2
by: Rick | last post by:
I have a situation where I have a method that I need to call. One of the parameters of this method is a string. There are potentially several string arrays that I could pass. Based on other...
11
by: John | last post by:
Hi I have a main form which contains a panel which contains a child form. So the hierarchy is as follows; frmMain->MyPanel-> frmChild I have a toolbar on the main form. When a user presses a...
6
by: Alex | last post by:
Hi... I have a stored procedure that takes in a large number of parameters (around 30) and returns (as output parameters) another 10 or so. At the moment, each parameter is declared, defined...
2
by: =?Utf-8?B?UHJpeWE=?= | last post by:
Hi, I'm faced with a classic problem of how to update a large number of records from a web page. I;m trying to build an interface that will display recordset in the order of 3000 rows and allow...
0
by: tony_in_da_uk | last post by:
On Jul 22, 5:27 am, eran <kale...@gmail.comwrote: I'm also with the params struct w/ constructor approach, but just to for a hoot I'll illustrate an alternative (pretty absurd) approach, which...
1
by: E11esar | last post by:
Hi there. I am writing a C# application and need to pass in a number such as 200003141070 but I'm not sure which datatype to use here as this number is a reference number but cannot be a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.