View Single Post
  #1 (permalink)  
Old August 11th, 2006, 06:48 AM
ps_kaushik ps_kaushik is offline
Registered User
 
Join Date: Mar 2005
Location: Kolkata, Westbengal, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Class building problem

Hello Everybody,

         I am in a new problem. I have to build a class in c# which actually fetches all the columns of a table created in SQLServer as its property, So that in time of using the class we get all the cloulms of the table and we can assign values easily for inserting deleting and updating. This is a very normal practise.

      But my problem is that my table contains more than 50 columns and not only for one table but I have to build such class for 80 tables.Obvoiusly you can imagine the problem.If I have to define each property for each column name then I have to write 50*80 properties.... Unthinkable.

    In SQLServer syscolumns and sysobjects contains everything about all the tables and their columns.

   My question is that : is there a way out through which I can generate automatic property and add it to my class.

Any help is appriciated.

Thank you,

Kaushik



KS
Reply With Quote