Becky Bloomwood

Becky Bloomwood

  • NA
  • 119
  • 285.8k

Unable to display data in grid view

Feb 13 2011 9:19 AM

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!


Answers (5)