473,473 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Conversion Error

When I run the following code:

{
if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item ||
(e.Item.ItemType ==
System.Web.UI.WebControls.ListItemType.Alternating Item))
{
int i = e.Item.Cells[6];
string s = i.ToString();
if (s == "0")
{
e.Item.Cells[0].Text = "NO";
}
}

I am getting the following error:

Cannot explicity convert type 'System.Web.WebUI.WebControls.TableCell' To int

What do I need to cnage to make this work?

Thanks,

Dave
Nov 16 '05 #1
1 965
if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item ||
(e.Item.ItemType ==
System.Web.UI.WebControls.ListItemType.Alternating Item))
{
if (e.Item.Cells[6].Text == "0")
{
e.Item.Cells[0].Text = "NO";
}

HTH

Ollie Riches

"kscdavefl" <ks*******@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
When I run the following code:

{
if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item ||
(e.Item.ItemType ==
System.Web.UI.WebControls.ListItemType.Alternating Item))
{
int i = e.Item.Cells[6];
string s = i.ToString();
if (s == "0")
{
e.Item.Cells[0].Text = "NO";
}
}

I am getting the following error:

Cannot explicity convert type 'System.Web.WebUI.WebControls.TableCell' To int
What do I need to cnage to make this work?

Thanks,

Dave

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Tim Johansson | last post by:
I'm new to C++, and tried to start making a script that will shuffle an array. Can someone please tell me what's wrong? #include <iostream.h> #include <string.h> int main () {...
7
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But...
2
by: Maurice | last post by:
Folks once again I look forward to your invaluable assistance. When converting an Access 2002 mdb back to Access 1997 using the Access 2002 inbuilt tools I receive the following error message...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
2
by: Harold Howe | last post by:
Howdy all, I am getting a compiler error regarding a consrained conversion. It complains that it can't make the type conversion, even though the generic type argument inherits from the target of...
6
by: Dhirendra Singh | last post by:
Hi, The following C++ program is not compiling on my system. #include <iostream> using namespace std; class complex { double re, im; public: complex( ) :re(0), im(0) {}
31
by: Martin Jørgensen | last post by:
Hi, I've had a introductory C++ course in the spring and haven't programmed in C++ for a couple of months now (but I have been programmed in C since january). So I decided to do my conversion...
11
by: jyck91 | last post by:
// Base Conversion // Aim: This program is to convert an inputted number // from base M into base N. Display the converted // number in base N. #include <stdio.h> #include <stdlib.h>...
3
by: fazulu deen | last post by:
Hi all, For the following code : file_ptr = fopen("pass_fail.txt", "a"); // error line 393 fdisplay(file_ptr, "Test Passed"); fclose(file_ptr);
6
by: Rahul | last post by:
Hi Everyone, I have the following code, class B; class A { public : operator B();
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.