Hi,I have declared a datatable that is somehow similar to the table in the database.
Code
DataTable dtgvCriticalTerms = null; //Reflect the CT table in SQL
Server
dtgvCriticalTerms = vrmdb.Get_CriticalTerms("ContractID").Tables[0];
Since the query string is ContractID, is my next step needs to declare a dataset such that it can store the data associated with this table?
Once i have this dataset, i need to add it back to the datatable that i have defined it early before? is it made use of this code:
Code
dtgvCriticalTerms = ViewState[viewStateGVCTName] as DataTable;
Thks!
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 17, 2011, 9:47 PM EST
0
Use DataSet when you have multiple tables to store or retrieve so you don't have to use DataSet just use DataTable directly and save and retrieve it from ViewState[] as i can see from your code.
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 17, 2011, 9:47 PM EST
Thanks.
Becky Bloomwood110 reputationPosted Feb 17, 2011, 9:57 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 21, 2011, 1:25 AM EST