Click here to Skip to main content
15,888,351 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: .Net Insanity Pin
Guffa26-Feb-08 12:02
Guffa26-Feb-08 12:02 
GeneralRe: .Net Insanity Pin
Pete O'Hanlon26-Feb-08 22:20
mvePete O'Hanlon26-Feb-08 22:20 
GeneralRe: .Net Insanity Pin
Rama Krishna Vavilala27-Feb-08 5:27
Rama Krishna Vavilala27-Feb-08 5:27 
GeneralRe: .Net Insanity [modified] Pin
#realJSOP27-Feb-08 4:51
mve#realJSOP27-Feb-08 4:51 
GeneralRe: .Net Insanity Pin
Pete O'Hanlon27-Feb-08 9:30
mvePete O'Hanlon27-Feb-08 9:30 
GeneralRe: .Net Insanity Pin
Colin Angus Mackay26-Feb-08 14:42
Colin Angus Mackay26-Feb-08 14:42 
GeneralRe: .Net Insanity Pin
#realJSOP27-Feb-08 4:58
mve#realJSOP27-Feb-08 4:58 
GeneralRe: .Net Insanity Pin
Rama Krishna Vavilala27-Feb-08 5:24
Rama Krishna Vavilala27-Feb-08 5:24 
John Simmons / outlaw programmer wrote:
So I want to create an instance of SqlParameterCollection.


You always have to do it through SqlCommand class. That is what serves as the factory for parameter collection. Parameter collection belongs to and works in close association with the command object. Things are internal or protected for a certain reason.

You are breaking Good OOP practices by using reflection. For instance, what will happen when in next version of .NET Microsoft decides to add a new internal constructor and decides to get rid of the default constructor. Your code will compile fine but will never run.

As people have suggested List<sqlparameter> is a slightly better option. But I would prefer to get rid of even that and use a method like this:

void ExecuteQuery(string query, IDictionary<string, object=""> values); </string,>


or even better

void ExecuteQuery(string query, params object[] values); 


The later one requires a little extra work, but is a better option IMO.

You have, what I would term, a very formal turn of phrase not seen in these isles since the old King passed from this world to the next. martin_hughes on VDK

QuestionAdd and remove rows on Button click Pin
Niya25-Feb-08 17:25
Niya25-Feb-08 17:25 
GeneralRe: Add and remove rows on Button click Pin
Christian Graus25-Feb-08 21:56
protectorChristian Graus25-Feb-08 21:56 
QuestionToolkit? Pin
PS@Codeproj25-Feb-08 1:50
PS@Codeproj25-Feb-08 1:50 
AnswerRe: Toolkit? Pin
Pete O'Hanlon25-Feb-08 3:20
mvePete O'Hanlon25-Feb-08 3:20 
AnswerRe: Toolkit? Pin
Paul Conrad25-Feb-08 8:48
professionalPaul Conrad25-Feb-08 8:48 
GeneralRe: Toolkit? Pin
PS@Codeproj25-Feb-08 17:29
PS@Codeproj25-Feb-08 17:29 
GeneralRe: Toolkit? Pin
Paul Conrad25-Feb-08 17:46
professionalPaul Conrad25-Feb-08 17:46 
GeneralRe: Toolkit? Pin
buchstaben26-Feb-08 21:01
buchstaben26-Feb-08 21:01 
Questionindeterminate progress bar Pin
veerbala24-Feb-08 19:00
veerbala24-Feb-08 19:00 
GeneralDouble Post - please ignore Pin
Giorgi Dalakishvili24-Feb-08 20:39
mentorGiorgi Dalakishvili24-Feb-08 20:39 
QuestionOpenVPN Pin
vikramspce198322-Feb-08 17:36
vikramspce198322-Feb-08 17:36 
General.NET 2 and German OS (XP Pro SP2) Pin
Antony M Kancidrowski22-Feb-08 6:01
Antony M Kancidrowski22-Feb-08 6:01 
GeneralRe: .NET 2 and German OS (XP Pro SP2) Pin
Christian Graus22-Feb-08 18:21
protectorChristian Graus22-Feb-08 18:21 
GeneralRe: .NET 2 and German OS (XP Pro SP2) Pin
Antony M Kancidrowski24-Feb-08 10:41
Antony M Kancidrowski24-Feb-08 10:41 
GeneralRe: .NET 2 and German OS (XP Pro SP2) Pin
Pete O'Hanlon23-Feb-08 10:52
mvePete O'Hanlon23-Feb-08 10:52 
GeneralRe: .NET 2 and German OS (XP Pro SP2) Pin
Christian Graus23-Feb-08 11:42
protectorChristian Graus23-Feb-08 11:42 
GeneralRe: .NET 2 and German OS (XP Pro SP2) Pin
Antony M Kancidrowski24-Feb-08 10:43
Antony M Kancidrowski24-Feb-08 10:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.