473,396 Members | 1,707 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,396 software developers and data experts.

Build error, no message

I am getting a build error but it doesn't give me an
error message. I know it has to do with the following
line of code. What could be the problem and why don't I
get an error message? Thanks.

for (int i = 0; i <= detailView1.Items.Count - 1; i++)
{
if (detailView1.Items[i].GetType().ToString().EndsWith
("ItemDateTime"))
{
if advancedList1.SelectedRow[detailView1.Items
[i].Name].ToString() <> ""

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name]
else

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name]
}
{

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name];

}
}
Nov 15 '05 #1
9 1403
For starters, I see some "<>" that should be "!="

"Phill" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I am getting a build error but it doesn't give me an
error message. I know it has to do with the following
line of code. What could be the problem and why don't I
get an error message? Thanks.

for (int i = 0; i <= detailView1.Items.Count - 1; i++)
{
if (detailView1.Items[i].GetType().ToString().EndsWith
("ItemDateTime"))
{
if advancedList1.SelectedRow[detailView1.Items
[i].Name].ToString() <> ""

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name]
else

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name]
}
{

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name];

}
}

Nov 15 '05 #2

"Phill" wrote...
I am getting a build error but it doesn't give me an
error message. I know it has to do with the following
line of code. What could be the problem ...


- Every if-expression must have
parantheses around the condition.

- All sentences must end with semicolon

- In C# we use "!=" instead of "<>"

// Bjorn A
Nov 15 '05 #3
Thanks, but still not compiling. Where do I need to
put ; I am a VB programmer converting to C# and am still
learning the syntax.
-----Original Message-----
For starters, I see some "<>" that should be "!="

"Phill" <an*******@discussions.microsoft.com> wrote in messagenews:00****************************@phx.gbl...
I am getting a build error but it doesn't give me an
error message. I know it has to do with the following
line of code. What could be the problem and why don't I get an error message? Thanks.

for (int i = 0; i <= detailView1.Items.Count - 1; i++)
{
if (detailView1.Items[i].GetType().ToString().EndsWith
("ItemDateTime"))
{
if advancedList1.SelectedRow[detailView1.Items
[i].Name].ToString() <> ""

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name]
else

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name]
}
{

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name];

}
}

.

Nov 15 '05 #4
Thank you. All is good now that I know the rules.
-----Original Message-----

"Phill" wrote...
I am getting a build error but it doesn't give me an
error message. I know it has to do with the following
line of code. What could be the problem ...


- Every if-expression must have
parantheses around the condition.

- All sentences must end with semicolon

- In C# we use "!=" instead of "<>"

// Bjorn A
.

Nov 15 '05 #5

"Phill" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I am getting a build error but it doesn't give me an
error message. I know it has to do with the following
line of code. What could be the problem and why don't I
get an error message? Thanks.

for (int i = 0; i <= detailView1.Items.Count - 1; i++)
{


Are you sure you need the -1.

ussually see this when the = sign is not used.

eg
for (int i = 0; i < detailView1.Items.Count - 1; i++) // no = sign.

or
for (int i = 0; i <= detailView1.Items.Count ; i++) // no -1

Nov 15 '05 #6

"Martin Stainsby" <getenoughspam@alreadythankyou> wrote in message
news:eP**************@TK2MSFTNGP09.phx.gbl...

"Phill" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I am getting a build error but it doesn't give me an
error message. I know it has to do with the following
line of code. What could be the problem and why don't I
get an error message? Thanks.

for (int i = 0; i <= detailView1.Items.Count - 1; i++)
{


Are you sure you need the -1.

ussually see this when the = sign is not used.

eg
for (int i = 0; i < detailView1.Items.Count - 1; i++) // no = sign.

or
for (int i = 0; i <= detailView1.Items.Count ; i++) // no -1


Beers kicking in.......

for (int i = 0; i = detailView1.Items.Count - 1; i++) // no < sign.
or
for (int i = 0; i < detailView1.Items.Count ; i++) // no -1

Nov 15 '05 #7
"Martin Stainsby" wrote...
"Phill" wrote in message...

for (int i = 0; i <= detailView1.Items.Count - 1; i++)
Are you sure you need the -1.
ussually see this when the = sign is not used.


You're correct that it usually isn't needed, but it is still syntactically
and logically correct code. Your examples are misleading since you've got
them the other way around.

If he wants to iterate through the whole collection, his use of -1 is
correct, but unneccessary, since the following does exactly the same thing,
but with one operation less per iteration (no -1, hence no = sign):

for (int i = 0; i < detailView1.Items.Count; i++)

In your first example he would miss the last item:
for (int i = 0; i < detailView1.Items.Count - 1; i++) // no = sign.
....and in your secon example he would run past the last item...
for (int i = 0; i <= detailView1.Items.Count ; i++) // no -1


....and an Exception would occur.

// Bjorn A
Nov 15 '05 #8

"Bjorn Abelli" <bj**********@DoNotSpam.hotmail.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...

In your first example he would miss the last item:
for (int i = 0; i < detailView1.Items.Count - 1; i++) // no = sign.


...and in your secon example he would run past the last item...
for (int i = 0; i <= detailView1.Items.Count ; i++) // no -1


...and an Exception would occur.

// Bjorn A


Yes I realised this, hence the reply I sent. Although you explain it nicely.
Nov 15 '05 #9
Can you please post the entire contents of the build output window and the
task window? It's possible the error message is just scrolling out of view?

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"Phill" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I am getting a build error but it doesn't give me an
error message. I know it has to do with the following
line of code. What could be the problem and why don't I
get an error message? Thanks.

for (int i = 0; i <= detailView1.Items.Count - 1; i++)
{
if (detailView1.Items[i].GetType().ToString().EndsWith
("ItemDateTime"))
{
if advancedList1.SelectedRow[detailView1.Items
[i].Name].ToString() <> ""

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name]
else

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name]
}
{

detailView1.Items[i].Value =
advancedList1.SelectedRow[detailView1.Items[i].Name];

}
}

Nov 15 '05 #10

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

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
10
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
8
by: John | last post by:
Here is the current error that im getting when building my solution. The only thing i can think of is that i needed to install visual studio 6 after visual studio .net was already installed to...
0
by: George Harig | last post by:
While building my deployment project I receive the following error Unable to build folder named "FOLDER_NAME". My projects compiles fine, the deployment project dose not. Are there any rules...
7
by: dm_dal | last post by:
I have a solution in VS.Net 2003. It contains 1 - asp.net project(c#), 1 - c# class library project and 1 - db project. When I try to build the solution, I get the following error: Could not...
3
by: prabhupr | last post by:
Hi Folks Not sure if this is the right group, if not please re-direct me to the right one. Here is my question =============== When I compile my ASP.NET WEB project from VS 2005 (.NET...
3
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from...
3
by: NickP | last post by:
Hi there, Today I try to compile an application of mine and I am getting a whole list of bizaar errors.... ------------------------------------------------ Error 1 The...
2
by: 2b|!2b==? | last post by:
I am having linkage errors in my release build as ff: ------ Build started: Project: myModule, Configuration: Release Win32 ------ Linking... Creating library c:\mypath\myModule.lib and object...
0
by: Darrin Thompson | last post by:
I've been trying to build pyOpenSSL on Windows with Visual Studio 2003. I've hit the message below: building 'OpenSSL.SSL' extension creating build\temp.win32-2.5\Release\src\ssl C:\Program...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.