0
Answer

Problem viewing updated database

Ask a question
x _sanctus

x _sanctus

18y
1.9k
1
Dear all, I create windows application using c# and i have problem using dataset. I create program to update database. The actual database content has updated. When i get the updated dataTable from the dataset to view the the current datatable content using the datatable default view, the content is still the old one. In order to view the content i use richtext & textbox, I dont want to use datagrid. How can i view the updated content without retrieve it from database again? Here is some of the code.. public DataTable getDataTable(string tableName){ return dataSet.Tables[tableName]; } private void refreshData(int id){ DataView temp=myDb.getUpdatedDataTable("tableName").DefaultView; temp.RowFilter="primary_key = "+id; ... //then fill the data form with updated value ... } //i change the getDataTable procedure but it still did't work public DataTable DataTable(string tableName){ if(dataSet.Tables[tableName].GetChanges()==null) return dataSet.Tables[tableName]; else return dataSet.Tables[tableName].GetChanges(); }