Last post Jan 09, 2014 02:46 AM by Fuxiang Zhang - MSFT
Jan 08, 2014 03:23 AM|V0916475|LINK
public void DeleteRecord(int UN_Contact, ModelMethodContext context)
Above is one method I have and I want to make this method generic. Everything is fine except UN_Contact parameter because I have nearly 40 tables and every table has got different column names.
I want something so that instead of UN_Contact parameter, I can use something generic so that this mehod will not depend on table but will work with every table.
Just to let you know, I am very new to programming and this is my first project I am working on.
I am using VS 2013, ASP.NET and language C#.
Jan 09, 2014 02:46 AM|Fuxiang Zhang - MSFT|LINK
I'm glad to see you post the issue to our forum.
From your description and code provided, I understand that you want a common method which can delete record from database tables.
As we all know that, if we want to delete a record from database, we should know the table name and the record identify.
According to your code, I think the parameter "UN_Contact" is the identify column of table. If you want the method aplay to all the database tables.
You should let all the tables have a common identify column.
Hope this helps, thanks.