Hello ,
Dynamic control id will get lost after post back .So to retain the Id of textboxes you need to create dynamic textboxes at PAGE_INIT method.
Here in your scenario you have to call your method "GetColumn(string tablename)" at the page_init method then only you can fetch your textbox id at button 2 click event.
private void Page_Init(Objectsender, System.EventArgs e)
{
GetColumn(string tablename)
}
Thanks
Hope this give some idea