473,835 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to fix Error - member names cannot be the same as their enclosing type

Expand|Select|Wrap|Line Numbers
  1. public partial class frmStoreMaster
  2.         {
  3.  
  4.             private void FillData(string StoreID)
  5.             {
  6.  
  7.                 DAStoreMaster objStoreMst = new DAStoreMaster();
  8.  
  9.                 try
  10.                 {
  11.                     StoreInfo objStoreInfo = new StoreInfo();
  12.                     objStoreInfo.StoreID = Convert.ToInt32(StoreID);
  13.                     objStoreInfo.StoreName = "";
  14.                     objStoreInfo.ContactPerson = "";
  15.  
  16.  
  17.                     DataTable dt_StoreInfo = objStoreMst.GetStoreInfo(objStoreInfo);
  18.  
  19.                     txtStoreName.Text = dt_StoreInfo.Rows[0]["Store_Name"].ToString();
  20.                     ddlFKStoregroup.SelectedValue = dt_StoreInfo.Rows[0]["FK_Store_group"].ToString();
  21.                     txtContactPerson.Text = dt_StoreInfo.Rows[0]["Contact_Person"].ToString();
  22.                     txtComments.Text = dt_StoreInfo.Rows[0]["Comments"].ToString();
  23.  
  24.  
  25.                 }
  26.                 catch (Exception ex)
  27.                 {
  28.                     throw (ex);
  29.                 }
  30.                 finally
  31.                 {
  32.                     objStoreMst = null;
  33.                 }
  34.             }
  35.  
Oct 2 '10 #1
1 2916
mldisibio
190 Recognized Expert New Member
That error comes from having a property with the same name as the Class to which it belongs.

The code you posted does not have any properties or fields, so you need to look more carefully at the error message to find which class, which file, which line it is referring to.
Oct 3 '10 #2

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

Similar topics

1
3391
by: valexena | last post by:
I am attempting to take tablespace offline and receiving the following error: ORA-01546- cannot take tablespace offline. What I am doing wrong? -- Posted via http://dbforums.com
5
3139
by: Walter Tross | last post by:
Somebody with a very regulatory mind in this newsgroup has written that it's better not to use a leading underscore for class member names, because names with a leading underscore are used internally by compilers (well, not so internally, since they appear in header files). I personally use the leading underscore (followed by a lower case letter), which I consider to be much more readable than the trailing underscore. My reasoning is...
5
32730
by: Nik | last post by:
I keep getting the following error 'member names cannot be the same as their enclosing type' with the code below. public class HelpText { private string _textToDisplay; private string _cssClass; public string TextToDisplay { get {return _textToDisplay;}
1
24254
by: | last post by:
in sub class i can't define a constructor it give me error when i want it to... "category member names cannot be the same as their enclosing type" namespace Database { public class Structure { public class category {
4
2750
by: don | last post by:
I have two existing interfaces having methods with same names. Now I have to implement both intrfaces in one class. Is there any way I could implement methods with same names in both interfaces without getting errors from the compiler?
4
1322
by: Turbot | last post by:
Hello, I have an ENUM that looks like this: Public Enum Locations As Byte Top_Left Top_Middle Top_Right Middle_Left Middle_Middle
3
16836
by: kaizen | last post by:
Hi, i wrote the code in C and compiled in VC++ compiler. at that time it has thrown the below mentioned error. error C2664: 'strcpy' : cannot convert parameter 2 from 'char' to 'const char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
2
5020
by: keithb | last post by:
A web site published from its development environment (VS Web Server) to an IIS 6.0 site displays this message: Compiler Error Message: CS0030: Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login' Anyone have an idea about the cause? Thanks,
1
4497
by: Veerle | last post by:
Hi, I generate class from xsd files using XSDObjectGen. But the generated code doesn't compile because there are properties with the same name as the class name, which is not allowed in C# : "member names cannot be the same as their enclosing type". I cannot alter the xsd files, because they are third party xsds, and the generated xml has to conform to this xsd schemas in order for us to be able to use them. Is there some kind of...
1
1585
by: asmx126453 | last post by:
hey guys next question :p its about the member names that the cant be the same the precies error is this 'VerzamelbladOverzicht': member names cannot be the same as their enclosing type its about this page VerzamelbladOverzicht.aspx <%@ Page language="c#" Inherits="DotNet.VerzamelbladOverzicht" debug="False" CodeFile="VerzamelbladOverzicht.aspx.cs" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
0
9810
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9653
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10815
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10563
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10237
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7770
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5808
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4435
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 we have to send another system
2
3999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.