473,471 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Identifier expected

I get the following errors from the code ( CRM 3.0 ) below, whats wrong ?
Any
suggestions are welcome because i'm kinda stuck here.

The first error is pointing on the last bracket ] <---

c:\inetpub\wwwroot\bredanaweb\jdshentlead.aspx.cs( 18,35): error CS1001:
Identifier expected

c:\inetpub\wwwroot\bredanaweb\jdshentlead.aspx.cs( 18,37): error CS1518:
Expected class, delegate, enum, interface, or struct

c:\inetpub\wwwroot\bredanaweb\jdshentlead.aspx.cs( 18,88): error CS1022: Type
or namespace definition, or end-of-file expected

// Set the columns to return.

ColumnSet cols = new ColumnSet();

cols.Attributes = new string [] {"subject", "firstname", "lastname",
"industrycode"};

Jack
Oct 13 '06 #1
9 17353
// check out this
cols.Attributes = {"subject", "firstname", "lastname", "industrycode"};

Oct 13 '06 #2
Jack <ja*******@jackd.dkwrote:
I get the following errors from the code ( CRM 3.0 ) below, whats wrong ?
Any
suggestions are welcome because i'm kinda stuck here.

The first error is pointing on the last bracket ] <---

c:\inetpub\wwwroot\bredanaweb\jdshentlead.aspx.cs( 18,35): error CS1001:
Identifier expected

c:\inetpub\wwwroot\bredanaweb\jdshentlead.aspx.cs( 18,37): error CS1518:
Expected class, delegate, enum, interface, or struct

c:\inetpub\wwwroot\bredanaweb\jdshentlead.aspx.cs( 18,88): error CS1022: Type
or namespace definition, or end-of-file expected

// Set the columns to return.

ColumnSet cols = new ColumnSet();

cols.Attributes = new string [] {"subject", "firstname", "lastname",
"industrycode"};
It would help if you'd post the complete file. My *guess* is that
you're trying to do this immediately within a class declaration rather
than within a method, property or constructor - but you haven't given
us enough context to say for sure.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 13 '06 #3
you can use this inside function body

Salman

Oct 14 '06 #4
import javax.swing.JOptionPane;
import java.text.DecimalFormat;

class Time3
{
private int hour;
private int minute;
private int second;

/*public Time3()
{
this(0,0,0);
}

public Time3(int h)
{
this(h,0,0);
}

public Time3(int h,int m)
{
this(h,m,0);
}*/

public Time3(int h,int m,int s)
{
setTime(h,m,s);
}

/*public Time3(Time3 time)
{
this(thim.getHour(),time.getMinute(),time.getSecon d());
}*/

public void setTime(int h,int m,int,s)
{
setHour(h);
setMinute(m);
setSecond(s);

}

public void setHour(int h)
{
hour = ((h>=0 && h<24) ? h : 0);
}

public void setMinute(int m)
{
minute = ((m>=0 && m<60) ? m :0);

}

public void setSecond(int s)
{
second = ((s>=0 && s<60) ? s :0)
}

public int getHour ()
{
return hour;

}
public int getMinute()
{
return minute;

}

public int getSecond()
{
return second;

}
public String a()
{
DecimalFormal twoDigits = new DecimalFormalt("00");

return twoDigits.formalt(getHour) + ":" +twoDigits.formalt(getMinute)
+ ":"+
twoDigits.formalt(getSecond);
}
/*public String b()
{
DecimalFormal twoDigits = new DecimalFormalt("00");
return ((getHour()==12||getHour==0) ? 12 : getHour() % 12 + ":"
+twoDigits.formalt(getMinute))+":"+
twoDigits.formalt(getSecond())+(getHour()<12 ? "AM " : "PM");
}*/
public static void main(String[] args)
{
Time3 time = new Time3();
time.a(23,22,12);
String w = time.a();
System.out.println(w);

System.out.println("Hello World!");
}
}
师傅帮个忙吧!
小弟刚开始**JAVA
这个程序在编译是出现了异常
能否解帮小弟决一下

Oct 26 '06 #5
import javax.swing.JOptionPane;
import java.text.DecimalFormat;

class Time3
{
private int hour;
private int minute;
private int second;

/*public Time3()
{
this(0,0,0);
}

public Time3(int h)
{
this(h,0,0);
}

public Time3(int h,int m)
{
this(h,m,0);
}*/

public Time3(int h,int m,int s)
{
setTime(h,m,s);
}

/*public Time3(Time3 time)
{
this(thim.getHour(),time.getMinute(),time.getSecon d());
}*/

public void setTime(int h,int m,int,s)
{
setHour(h);
setMinute(m);
setSecond(s);

}

public void setHour(int h)
{
hour = ((h>=0 && h<24) ? h : 0);
}

public void setMinute(int m)
{
minute = ((m>=0 && m<60) ? m :0);

}

public void setSecond(int s)
{
second = ((s>=0 && s<60) ? s :0)
}

public int getHour ()
{
return hour;

}
public int getMinute()
{
return minute;

}

public int getSecond()
{
return second;

}
public String a()
{
DecimalFormal twoDigits = new DecimalFormalt("00");

return twoDigits.formalt(getHour) + ":" +twoDigits.formalt(getMinute)
+ ":"+
twoDigits.formalt(getSecond);
}
/*public String b()
{
DecimalFormal twoDigits = new DecimalFormalt("00");
return ((getHour()==12||getHour==0) ? 12 : getHour() % 12 + ":"
+twoDigits.formalt(getMinute))+":"+
twoDigits.formalt(getSecond())+(getHour()<12 ? "AM " : "PM");
}*/
public static void main(String[] args)
{
Time3 time = new Time3();
time.a(23,22,12);
String w = time.a();
System.out.println(w);

System.out.println("Hello World!");
}
}
师傅帮个忙吧!
小弟刚开始**JAVA
这个程序在编译是出现了异常
能否解帮小弟决一下

Oct 26 '06 #6
import javax.swing.JOptionPane;
import java.text.DecimalFormat;

class Time3
{
private int hour;
private int minute;
private int second;

/*public Time3()
{
this(0,0,0);
}

public Time3(int h)
{
this(h,0,0);
}

public Time3(int h,int m)
{
this(h,m,0);
}*/

public Time3(int h,int m,int s)
{
setTime(h,m,s);
}

/*public Time3(Time3 time)
{
this(thim.getHour(),time.getMinute(),time.getSecon d());
}*/

public void setTime(int h,int m,int,s)
{
setHour(h);
setMinute(m);
setSecond(s);

}

public void setHour(int h)
{
hour = ((h>=0 && h<24) ? h : 0);
}

public void setMinute(int m)
{
minute = ((m>=0 && m<60) ? m :0);

}

public void setSecond(int s)
{
second = ((s>=0 && s<60) ? s :0)
}

public int getHour ()
{
return hour;

}
public int getMinute()
{
return minute;

}

public int getSecond()
{
return second;

}
public String a()
{
DecimalFormal twoDigits = new DecimalFormalt("00");

return twoDigits.formalt(getHour) + ":" +twoDigits.formalt(getMinute)
+ ":"+
twoDigits.formalt(getSecond);
}
/*public String b()
{
DecimalFormal twoDigits = new DecimalFormalt("00");
return ((getHour()==12||getHour==0) ? 12 : getHour() % 12 + ":"
+twoDigits.formalt(getMinute))+":"+
twoDigits.formalt(getSecond())+(getHour()<12 ? "AM " : "PM");
}*/
public static void main(String[] args)
{
Time3 time = new Time3();
time.a(23,22,12);
String w = time.a();
System.out.println(w);

System.out.println("Hello World!");
}
}
师傅帮个忙吧!
小弟刚开始**JAVA
这个程序在编译是出现了异常
能否解帮小弟决一下

Oct 26 '06 #7
import javax.swing.JOptionPane;
import java.text.DecimalFormat;

class Time3
{
private int hour;
private int minute;
private int second;

/*public Time3()
{
this(0,0,0);
}

public Time3(int h)
{
this(h,0,0);
}

public Time3(int h,int m)
{
this(h,m,0);
}*/

public Time3(int h,int m,int s)
{
setTime(h,m,s);
}

/*public Time3(Time3 time)
{
this(thim.getHour(),time.getMinute(),time.getSecon d());
}*/

public void setTime(int h,int m,int,s)
{
setHour(h);
setMinute(m);
setSecond(s);

}

public void setHour(int h)
{
hour = ((h>=0 && h<24) ? h : 0);
}

public void setMinute(int m)
{
minute = ((m>=0 && m<60) ? m :0);

}

public void setSecond(int s)
{
second = ((s>=0 && s<60) ? s :0)
}

public int getHour ()
{
return hour;

}
public int getMinute()
{
return minute;

}

public int getSecond()
{
return second;

}
public String a()
{
DecimalFormal twoDigits = new DecimalFormalt("00");

return twoDigits.formalt(getHour) + ":" +twoDigits.formalt(getMinute)
+ ":"+
twoDigits.formalt(getSecond);
}
/*public String b()
{
DecimalFormal twoDigits = new DecimalFormalt("00");
return ((getHour()==12||getHour==0) ? 12 : getHour() % 12 + ":"
+twoDigits.formalt(getMinute))+":"+
twoDigits.formalt(getSecond())+(getHour()<12 ? "AM " : "PM");
}*/
public static void main(String[] args)
{
Time3 time = new Time3();
time.a(23,22,12);
String w = time.a();
System.out.println(w);

System.out.println("Hello World!");
}
}
师傅帮个忙吧!
小弟刚开始**JAVA
这个程序在编译是出现了异常
能否解帮小弟决一下

Oct 26 '06 #8
import javax.swing.JOptionPane;
import java.text.DecimalFormat;

class Time3
{
private int hour;
private int minute;
private int second;

/*public Time3()
{
this(0,0,0);
}

public Time3(int h)
{
this(h,0,0);
}

public Time3(int h,int m)
{
this(h,m,0);
}*/

public Time3(int h,int m,int s)
{
setTime(h,m,s);
}

/*public Time3(Time3 time)
{
this(thim.getHour(),time.getMinute(),time.getSecon d());
}*/

public void setTime(int h,int m,int,s)
{
setHour(h);
setMinute(m);
setSecond(s);

}

public void setHour(int h)
{
hour = ((h>=0 && h<24) ? h : 0);
}

public void setMinute(int m)
{
minute = ((m>=0 && m<60) ? m :0);

}

public void setSecond(int s)
{
second = ((s>=0 && s<60) ? s :0)
}

public int getHour ()
{
return hour;

}
public int getMinute()
{
return minute;

}

public int getSecond()
{
return second;

}
public String a()
{
DecimalFormal twoDigits = new DecimalFormalt("00");

return twoDigits.formalt(getHour) + ":" +twoDigits.formalt(getMinute)
+ ":"+
twoDigits.formalt(getSecond);
}
/*public String b()
{
DecimalFormal twoDigits = new DecimalFormalt("00");
return ((getHour()==12||getHour==0) ? 12 : getHour() % 12 + ":"
+twoDigits.formalt(getMinute))+":"+
twoDigits.formalt(getSecond())+(getHour()<12 ? "AM " : "PM");
}*/
public static void main(String[] args)
{
Time3 time = new Time3();
time.a(23,22,12);
String w = time.a();
System.out.println(w);

System.out.println("Hello World!");
}
}
师傅帮个忙吧!
小弟刚开始**JAVA
这个程序在编译是出现了异常
能否解帮小弟决一下

Oct 26 '06 #9

<ya***************@126.comwrote in Java something that could look like
this in C#...

using System;

namespace Time3
{
public class Time3
{
private int hour;
private int minute;
private int second;

public Time3(int h, int m, int s)
{
SetTime(h, m, s);
}

public void SetTime(int h, int m, int s)
{
Hour = h;
Minute = m;
Second = s;

}

public int Hour
{
get
{
return hour;
}
set
{
hour = ((value >= 0 && value < 24) ? value : 0);
}
}

public int Minute
{
get
{
return minute;
}
set
{
minute = ((value >= 0 && value < 60) ? value : 0);
}

}

public int Second
{
get
{
return second;
}
set
{
second = ((value >= 0 && value < 60) ? value : 0);
}
}

public override string ToString()
{
return String.Format("{0:00}:{1:00}:{2:00}", Hour, Minute,
Second);
}

public static void Main()
{
Time3 time = new Time3(23, 22, 12);
Console.WriteLine(time);
Console.WriteLine("Hello World!"); }
}
}

/// Bjorn A
Oct 26 '06 #10

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

Similar topics

3
by: Jon Paal | last post by:
what's missing here ? Compiler Error Message: BC30203: Identifier expected. Source Error: Line 11 Line 9: Public Class GetVol Line 10: Line 11: Private...
7
by: Tony Tone | last post by:
I am having trouble resolving this issue: Server Error in '/test' Application. -------------------------------------------------------------------------------- Compilation Error Description:...
7
by: VK | last post by:
I was getting this effect N times but each time I was in rush to just make it work, and later I coudn't recall anymore what was the original state I was working around. This time I nailed the...
2
by: jdziggy | last post by:
Hey all I am getting the compiler Identifier Expected on the following code. public partial class Form1 : Form { private const int MaxFiles = 10; private SourceFile...
2
by: dobbouk | last post by:
I'm getting these 2 errors and haven't got a clue whats causing them please java 43: illegal start of type for (i=0;i< Number_of_squares; i++) java 215 identifier expected } ...
4
by: CodeTilYaDrop | last post by:
I am still pretty new to programming, and I sometimes can not figure something out. I am getting an error with this line in my program: Public void count_syllables(int count_syllables) I get...
1
by: Prat4u | last post by:
Hi I'm having <identifier> expected error when i compile the following code in the test application in java. Player player = new Player("Red Guy", Color.red, new Point(100,100), 0); ...
2
by: camzgon121 | last post by:
Hi guys, I have this code and when I try to compile and run it gives me an <identifier> expected error. The code with the irrelevant parts taken out. package ACCOUNT; import...
3
oll3i
by: oll3i | last post by:
package ejb; import javax.ejb.EJBObject; import java.rmi.RemoteException; import java.sql.Connection; import java.util.Map; public interface InterfaceRemote extends EJBObject { public Map...
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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 ...

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.