473,386 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cannot Convert implicit datatype from int to bool

the Following code is working in VB.net

int UserType

Dim parameterUserType As SqlParameter = New SqlParameter("@UserType", SqlDbType.BigInt, 8)
parameterUserType.Direction = ParameterDirection.Output
ObjCommand.Parameters.Add(parameterUserType)

ObjCommand.ExecuteNonQuery()


UserType = CInt(parameterUserType.Value)

But in C#
int usertype
SqlParameter p4 = new SqlParameter("@usertype", SqlDbType.BigInt, 8);
p4.Direction = ParameterDirection.Output;

cmd.Parameters.Add(p4);
objdb.getConnectOpen();
cmd.ExecuteNonQuery();
usertype = Convert.ToInt32(p4.Value);

I know that Convert.ToInt32 takes BOOl value .. but if i want to place Expression (p4.value) in thiz then Wat should i do? plz help me

Ayesha
Mar 25 '07 #1
0 1326

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Simon Ford | last post by:
Hi All, I'm having trouble understanding exactly how I can do some specific implicit casting. There are two problems here; does anyone know what I should be doing? //---------- // (1)...
1
by: chuayongquan | last post by:
When i do this statement: insert into table (cost) values ('2') cost column is a bigint datatype. will it auto convert the string 2 into integer 2???
2
by: Jon Shemitz | last post by:
How come I can write code like "if (L)" but NOT code like "if (L == true)" when L is a class with an implicit operator bool? /////////// List L = new List(); public class List { private...
22
by: Christoph Boget | last post by:
I am getting an error (a few among many) for the following lines of code: retval.BrokerName = (( curRow == System.DBNull.Value ) ? SqlString.Null : (string)curRow ); retval.BrokerGroupId = ((...
2
by: ABC | last post by:
I have a very large amount VB code convert into C Sharp. I just complete it use tools. But it still have some codes errors. There are object to datatype problems. I need to edit many files to...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
2
by: tim | last post by:
We've started to use a coding standards checker at work. The following code results in a warning: 38: CPlainText::CPlainText(const char *szPath,bool bTimeStamp,bool bSaveLast) 39: ...
2
by: Christophe | last post by:
class A {} class B {} interface MyInterface { void method(A a); void method(B b); }
6
by: John | last post by:
The following code: int test = 1; bool isTrue = (bool)test; results in a compiler error: Cannot convert type 'int' to 'bool' wtf, any ideas on how to work around this?
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.