Resign Designs

Resign Designs

  • NA
  • 31
  • 30k

How to remove tab page dynamically?

May 19 2015 4:39 AM
Hi,
 
 I need to remove tabpage dynamically based on a result from database.DB result having tabpage names.
 
 SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
string langname = reader.GetString(0);
TabControl.TabPages.Remove(langname);
}
 
Error showing in highlighted section saying it has some invalid arguments.
When I put a tabpage name manually instead of langname it is working.

How can I achieve this?
Thanks

Answers (1)