Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Sun, 23 Mar 2008 19:37:17 -0700 (PDT),    group: microsoft.public.dotnet.datatools        back       


Running stored procedure - input parameter cannot be converted   
Hello,

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.

Thanks

Ray
date: Sun, 23 Mar 2008 19:37:17 -0700 (PDT)   author:   rbrowning1958

Re: Running stored procedure - input parameter cannot be converted   
On Mar 24, 1:37 pm, rbrowning1958  wrote:
> Hello,
>
> 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 "Inputparameter cannot be converted". Ideas anyone? Can run it from SQL
> Server without problem.
>
> Thanks
>
> Ray

Not so much of an answer as another complaint -
I have been using the debug process for SQL server procedures until 26
March 2008, and now the same procedures have started to exhibit the
same error you mention.
I found that it is the BIT type variables that complain now, after
working fine for two weeks

When I convert them to TINYINT, they work!

A fellow programmer seemed to remember an existing fault in Vis Studio
regarding BIT types, and this seems to be the problem.

maybe that will help you also

Cheers

Ray
date: Wed, 26 Mar 2008 17:42:59 -0700 (PDT)   author:   Accessed

Re: Running stored procedure - input parameter cannot be converted   
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 Management
http://www.celticwolf.com/  |  Technical Writing
(703) 580-0210              |  Research
date: Mon, 31 Mar 2008 21:37:05 -0400   author:   Charles Calvert

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us