Hi, I am doing a web application such that when user clicks on the hyerplink, they can only view specific records tied to it. In the first page, it contains all the contract general information and the Contract ID is a hyerplink in which user can click on it to view more details. The more details is at the second page, in which user can know the critical terms, document and checklist tied to each contract ID. For example I have defined a stored procedure, database.cs and business logic to display only specific data in the grid view.
This is my database.cs:
//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);
}
|
This is the stored procedure:
ALTER PROCEDURE [VRM].[GET_CriticalTerms]
(
@ContractId varchar (10)
)
AS
SELECT * FROM VRM.CriticalTerms Where ContractId = @ContractId
ORDER BY terms
|
This is the business logic:
//populate the criticalterms datatable
DataTable tmpdt =
vrmdb.Get_CriticalTerms().Tables[0];
tmpdt.PrimaryKey = new DataColumn[] { tmpdt.Columns[0]
};
ViewState[viewStateGVName] = tmpdt;
|
But there is an error indicating:
Server Error in '/VRM_WebSite' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1501: No overload for method 'Get_CriticalTerms' takes '0' arguments
Source Error:
|
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] }; |
Source File: c:\Users\Maggie\Desktop\Peggie\Peggie\Deployment Source\Phase 1\Deployment 25 Nov for StarHub\VS Projects Source\VRM_WebSite\app\vrm\ContractThreeGridView.aspx.cs Line: 56
Thks!
Suthish NairPosted Feb 14, 2011, 10:40 AM
Becky BloomwoodPosted Feb 14, 2011, 10:29 AM
Suthish NairPosted Feb 14, 2011, 10:14 AM
It seems you working with this for a long time. Post the pages so we can have a check.
Becky BloomwoodPosted Feb 14, 2011, 2:55 AM
Server Error in '/VRM_WebSite' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'contractID' does not exist in the current context
Source Error:
Line 61: //ViewState[viewStateGVName] = tmpdt; Line 62: DataTable tmpdt = new DataTable(); Line 63: tmpdt = vrmdb.Get_CriticalTerms((contractID)).Tables[0]; Line 64: tmpdt.PrimaryKey = new DataColumn[] { tmpdt.Columns[0] }; Line 65: tmpdt.AcceptChanges();ViewState[viewStateGVName] = tmpdt;Source File: c:\Users\L31410\Desktop\Peggie\Peggie\Deployment Source\Phase 1\Deployment 25 Nov for StarHub\VS Projects Source\VRM_WebSite\app\vrm\ContractThreeGridView.aspx.cs Line: 63
Initially the error indicates that i have to add in bracket, how shld i resolve it? thks:)
Suthish NairPosted Feb 13, 2011, 11:02 AM