Click here to Skip to main content
15,904,415 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi
.net dont recognize <tableclass> in following command:
List<tableclass> list = MyCheckedList();

how can i create a List<tableclass>

thanks
Posted
Comments
[no name] 5-Nov-13 5:15am    
Hi,
I gave a smaple example below.
It will be helpfull, if you give more details in your question.

Have you created the function "MyCheckedList()" yet? If so, does it return an object of type List? if not then it will never work.

Some basic research does not go amiss with this sort of thing!

Read the following:
Google Search Results Because This is where research and problem solving starts![^]
Number 1 Google Result, it has examples![^]

In future, stop and think for a second, seriously, if you are attempting to write code, then learn to look things up before posting. Once you have tried stuff and are having actual problems then think about posting on here. And read the FAQ![^]
 
Share this answer
 
Comments
Thomas ktg 5-Nov-13 5:45am    
My +5ed
Hi,

You can create a List in C# be defining the Datatype of your List as String or Int or Double List.

See the Basic Sample below.

XML
class Sample
  {
      static void Main(string[] args)
      {
          List<string> listNames = MyNameList();

      }

      private static List<string> MyNameList()
      {
          List<string> names = new List<string>();

          names.add("Veera");
          names.add("Boomi");
          names.add("Vijay");
          names.add("Venu");

          return names;
      }

  }
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900