|
|
|
date: Sun, 23 Mar 2008 19:37:17 -0700 (PDT),
group: microsoft.public.dotnet.datatools
back
Re: Running stored procedure - input parameter cannot be converted
On Apr 1, 2:37 am, Charles Calvert wrote:
> On Sun, 23 Mar 2008 19:37:17 -0700 (PDT),rbrowning1958
> wrote in
> :
>
> >VS2005 - SQL Server 2005.
>
> >Running an SP from the server explorer window. The SP accepts two
> >parameters:
>
> > @s varchar(128) = NULL,
> > @b bit = 0
>
> >I cannot seem to set the bit value. I receive the error "Input
> >parameter cannot be converted". Ideas anyone? Can run it from SQL
> >Server without problem.
>
> What is the code that you're using to set the bit? I'm using 2003, so
> I think the classes are slightly different, but if you use an instance
> of System.Data.SqlClient.SqlCommand and add a parameter like this:
>
> cmd.Parameters.Add(
> new System.Data.SqlClient.SqlParameter(
> "@b",
> System.Data.SqlDbType.Bit,
> 1
> )
> );
>
> it should work.
> --
> Charles Calvert | Software Design/Development
> Celtic Wolf, Inc. | Project Managementhttp://www.celticwolf.com/ | Technical Writing
> (703) 580-0210 | Research
Hello,
I can set it in code - that's not the problem. It's running it from
within the Visual Studio IDE which is the problem. It runs OK from
within SQL Server management studio, however.
Best
Ray
date: Sun, 6 Apr 2008 04:56:58 -0700 (PDT)
author: rbrowning1958
|
|