473,398 Members | 2,368 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,398 software developers and data experts.

"The modifier 'readonly' is not valid for this item"

I need help with this error :"The modifier 'readonly' is not valid for this item"

I am writing this code in projrct type class Library
Here is the code:
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6.  
  7. namespace BE
  8. {
  9.     public enum STATUSACCOUNT { Bounded, Active, OnProbation };
  10.     public class Account
  11.     {
  12.         public int AccountNumber { get; set; }
  13.         public int AccountBranchNumber { get; set; }
  14.         public readonly DateTime DateOpeingAccount { get; set; } //error
  15.         public STATUSACCOUNT StatusAccount { get; set; }
  16.         public string Password { get; set; }
  17.         public int Balance { get; set; }
  18.         public int CreditFacility { get; set; }
  19.         public DateTime CreditFacilityExpiration { get; set; }
  20.         public string TypeAccount { get; set; }
  21.     }
  22. }
Thank you very much.
Dec 15 '12 #1
1 14454
PsychoCoder
465 Expert Mod 256MB
I would think you're getting that error because you have a getter & setter but have marked it as read only, which just cannot work. Try changing it to this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. public DateTime DateOpeingAccount { get; private set; }
  3.  
Dec 15 '12 #2

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

Similar topics

3
by: Big Dave | last post by:
Hello All, I was wondering wether anyone could help me solve what is probably a very easy issue. I keep getting this damn "The administrative limit for this request was exceeded" whenever I try to...
8
by: VB Programmer | last post by:
I have a web solution that I deployed to our web server. I was looking at the site (on my PC), and so was my customer (on his PC). It worked well for like 10 minutes. Then, all of a sudden we...
5
by: Stan | last post by:
When I create a Web project and then try to add the files to it (Add Existing Item), I get this error message "The folder http://localhost/FinWeb is no longer availabe" In fact the folder and...
2
by: Steve M | last post by:
A few users today received the message "The trust relationship between this workstation and the primary domain failed" on their web browser while using an ASP.NET web app. The problem went away...
2
by: TG | last post by:
I'm using the System.DirectoryServices.DirectorySearcher.Findall method to attempt to retrieve user id's from an Exchange LDAP server. I get the error message "The administrative limit for this...
0
by: David | last post by:
I am having an issue with Visual Studio .net and consuming WEB services. When I attempt to write a program to consume the service, I get the message "The proxy settings on this computer are not...
0
by: keikoo | last post by:
Hi, I need some help with this control. There's a windows form with a axwebbrowser control inside, so users can navigate to a page and it's necessary to keep the session, because, users will...
33
by: STILL LEARNING | last post by:
I'm not sure if this can even be done, but what prompts the question is my desire to be able to create an "Uber Link" script/code of some sort, such that even if the html page contains nothing but...
12
by: dkurth | last post by:
Hi, I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cUrl working, so in my php.ini file, I have this line: extension_dir ="F:\PHP\ext" And later, I have: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...

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.