Re: SqlParameter ???



yes thanks, i know about the sqldbtype...thank u so much, but my main
question was about using or not SqlParameter class if u can access via
SqlCommand too...you think is SqlParameter as i saw, not ?

thnaks in advance

--

Atenciosamente,

Daniel Groh
CTF Technologies do Brasil Ltda.
Analista Programador
Fone: 11 3837-4203
E-mail: dgroh@xxxxxxxxxx
"Michael C#" <howsa@xxxxxxxxxxx> escreveu na mensagem
news:uCG6l8zTFHA.2712@xxxxxxxxxxxxxxxxxxxxxxx
> Neither one. typeof(string) should be a SqlDbType (Char, VarChar, etc.)
>
> This method works just fine if you want to use the defaults for your
> parameter:
>
> MyCommand.Parameters.Add("@param1", SqlDbType.VarChar, 255).Value =
> "Hello";
>
> For cases where I don't want defaults used (i.e., .Direction, etc.), I
> prefer this method since it's a little cleaner:
>
> SqlParameter myParam = new SqlParameter();
> myParam.Size = 255;
> myParam.Value = "Hello";
> myParam.Direction = ParameterDirection.Output;
> MyCommand.Parameters.Add(myParam);
>
> "Daniel Groh" <newsgroupms@xxxxxxxxx> wrote in message
> news:eP9ODzzTFHA.4092@xxxxxxxxxxxxxxxxxxxxxxx
>> What is the best way to access a procedure ?
>>
>> MyCommand.Parameters.Add("@param1",typeof(string));
>>
>> or
>>
>> SqlParameter myParam = new SqlParameter();
>> myParam.Add("@param1",typeof(string));
>>
>> What do you think ?
>>
>> --
>>
>> Atenciosamente,
>>
>> Daniel Groh
>> CTF Technologies do Brasil Ltda.
>> Analista Programador
>> Fone: 11 3837-4203
>> E-mail: dgroh@xxxxxxxxxx
>>
>
>


.