//methods to GET criticalterms public DataSet Get_CriticalTerms(string contractID)//Tied to search function.This is the business logic { SqlCommand cmd_CriticalTermsList = new SqlCommand(); cmd_CriticalTermsList.CommandText = "[VRM].[Get_CriticalTerms]"; cmd_CriticalTermsList.CommandType = CommandType.StoredProcedure; cmd_CriticalTermsList.Parameters.Clear(); SqlParameter sqlParaContractID = new SqlParameter("@contractID", SqlDbType.VarChar, 10); //Contract Start DATE sqlParaContractID.Value = contractID; cmd_CriticalTermsList.Parameters.Add(sqlParaContractID); DataSet ds_ContractList = getDataSet(cmd_CriticalTermsList); return getDataSet(cmd_CriticalTermsList); }
ALTER PROCEDURE [VRM].[GET_CriticalTerms] ( @ContractId varchar (10) ) AS SELECT * FROM VRM.CriticalTerms Where ContractId = @ContractId ORDER BY terms
//populate the criticalterms datatable DataTable tmpdt = vrmdb.Get_CriticalTerms().Tables[0]; tmpdt.PrimaryKey = new DataColumn[] { tmpdt.Columns[0] }; ViewState[viewStateGVName] = tmpdt;
Line 54: Line 55: //populate the criticalterms datatable Line 56: DataTable tmpdt = vrmdb.Get_CriticalTerms().Tables[0]; Line 57: Line 58: tmpdt.PrimaryKey = new DataColumn[] { tmpdt.Columns[0] };