473,811 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1842
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***@discussi ons.microsoft.c omwrote:
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.co m>
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***@discussi ons.microsoft.c omwrote:
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.co m>
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***@discussi ons.microsoft.c omwrote:
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.co m>
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
6414
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 something I'll need in this case is some experience-based set of rules about how to use python in this context. For example... is defining readonly attributes in classes worth the hassle ? Does duck-typing scale well in complex
0
1850
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 number records return (> 12000), anything less 7000 is fine (I had not tried any number between). Wonder why? I am using oracle 8.1.7, retrun table type reocrds with my IIS 4 on NT 4 'ASP sysntax as ... set commBinAct = server.CreateObject...
5
3027
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 version also worked ? I can't understand why that worked. The only thing I can come up with is that the compiler gave me a break (although I did not receive any
2
1466
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 information, I can derive the name of the string array to pass to the called method. But I can't figure out how to take the derived array name (a string) and use it to get the actual string having that name to pass as a paramater. Any help...
11
2214
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 button on the toolbar, how can I pass on the event to the child form? Taking it further, is it possible to make it generic so that event is passed to any child form (frmchild1, frmchild2,... so on) that is currently open in
6
2568
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 and added in my C# code as follows: SqlParameter prmCustAcctID = cmd.CreateParameter(); prmCustAcctID.ParameterName = "@CustAcctID";
2
2439
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 the user to edit and update records from that interface. I have cached some static lists in the page but the main recordset should reflect updated data so it can't be cached. I also compute some control functions over the whole data. This will...
0
178
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 successively changes the compiler's notion of type such that a call only becomes possible when all parameters are set. ( Yes - enums would have been better ) Cheers, Tony
1
2543
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 string value for business reasons. I am using the System.Data.OracleClient and so when adding a parameter to the stored procedure command call, I am using a line such as: comm.Parameters.Add("param1", OracleType.Number).Value = largeValue;
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10403
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4341
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.