Click here to Skip to main content
15,924,507 members
Home / Discussions / C#
   

C#

 
GeneralProblem with Stored Procedure Pin
ronin177021-Jun-04 15:30
ronin177021-Jun-04 15:30 
GeneralRe: Problem with Stored Procedure Pin
Xiangyang Liu 刘向阳21-Jun-04 15:52
Xiangyang Liu 刘向阳21-Jun-04 15:52 
GeneralRe: Problem with Stored Procedure Pin
ronin177021-Jun-04 17:23
ronin177021-Jun-04 17:23 
GeneralRe: Problem with Stored Procedure Pin
Christian Graus21-Jun-04 18:27
protectorChristian Graus21-Jun-04 18:27 
GeneralRe: Problem with Stored Procedure Pin
Iknow22-Jun-04 2:02
Iknow22-Jun-04 2:02 
GeneralRe: Problem with Stored Procedure Pin
Wender Oliveira22-Jun-04 2:17
Wender Oliveira22-Jun-04 2:17 
GeneralRe: Problem with Stored Procedure Pin
ronin177022-Jun-04 3:01
ronin177022-Jun-04 3:01 
GeneralRe: Problem with Stored Procedure Pin
Heath Stewart22-Jun-04 3:03
protectorHeath Stewart22-Jun-04 3:03 
The last two replies are correct, in that you're not declaring your field as a string, but are instead declaring it as a char.

I wanted to add that the above code can be made much more efficient by not using the indexer to access your param. The SqlParameterCollection.Add overload you're using returns a SqlParameter, so you can either type .Value = value; immediately after your closing parenthesis, or store the return value from Add to a SqlParameter variable and assign the value from there. The latter way works best when executing a batch of statements (add the parameters to the command and loop to add each iteration's values without re-adding the params again; execute the command with each iteration).

This will result in better performance, since a string lookup on a collection can be very slow (mO(n) processing time, where n is the number of items in a collection and m is the number of iterations; compare that to O(m)).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Problem with Stored Procedure Pin
Anonymous22-Jun-04 3:29
Anonymous22-Jun-04 3:29 
Generalmarshalling a pointer member in struct from c# Pin
rana7421-Jun-04 14:16
rana7421-Jun-04 14:16 
GeneralRe: marshalling a pointer member in struct from c# Pin
Heath Stewart22-Jun-04 2:56
protectorHeath Stewart22-Jun-04 2:56 
GeneralRe: marshalling a pointer member in struct from c# Pin
rana7422-Jun-04 14:23
rana7422-Jun-04 14:23 
GeneralRe: marshalling a pointer member in struct from c# Pin
Heath Stewart22-Jun-04 15:14
protectorHeath Stewart22-Jun-04 15:14 
GeneralRe: marshalling a pointer member in struct from c# Pin
rana7422-Jun-04 16:28
rana7422-Jun-04 16:28 
GeneralRe: marshalling a pointer member in struct from c# Pin
Heath Stewart22-Jun-04 16:46
protectorHeath Stewart22-Jun-04 16:46 
GeneralRe: marshalling a pointer member in struct from c# Pin
rana7422-Jun-04 21:03
rana7422-Jun-04 21:03 
GeneralRe: marshalling a pointer member in struct from c# Pin
Heath Stewart22-Jun-04 21:06
protectorHeath Stewart22-Jun-04 21:06 
GeneralActive Directory & Multiple Connections Pin
inyoursadachine21-Jun-04 14:02
inyoursadachine21-Jun-04 14:02 
GeneralRe: Active Directory & Multiple Connections Pin
Heath Stewart22-Jun-04 2:51
protectorHeath Stewart22-Jun-04 2:51 
GeneralEncoding Pin
eggie521-Jun-04 12:39
eggie521-Jun-04 12:39 
GeneralRe: Encoding Pin
Christian Graus21-Jun-04 14:29
protectorChristian Graus21-Jun-04 14:29 
GeneralRe: Encoding Pin
eggie521-Jun-04 18:21
eggie521-Jun-04 18:21 
GeneralRe: Encoding Pin
Christian Graus21-Jun-04 18:23
protectorChristian Graus21-Jun-04 18:23 
GeneralRe: Encoding Pin
eggie522-Jun-04 8:54
eggie522-Jun-04 8:54 
GeneralRe: Encoding Pin
Steven Campbell21-Jun-04 15:39
Steven Campbell21-Jun-04 15:39 

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.