Hi,
I'm using Linq-To-Sql.
Given the following code:
casefile.cs
publicpartialclasscasefile
{
publicstaticint getCaseId(string asCaseNumber)
{
int aiCaseId = -1;
using (CMSDataContext dc =new CMSDataContext())
{
aiCaseId = (from cin dc.casefile
where c.case_nbr == asCaseNumber
select c.case_id).FirstOrDefault();
if (aiCaseId ==null || aiCaseId < 1)
{
thrownewException(String.Concat("Case
Number ", asCaseNumber, " not found."));
}
}
return aiCaseId;
}
}
WebFormCMSCopyCommentEvent.aspx.cs
publicpartialclassWebFormCMSCopyCommentEvent : System.Web.UI.Page
{
protectedvoid ButtonShowRecords_Click(object sender,EventArgs e)
{
//validate CaseIds
int aiCaseId1 =casefile.getCaseId(TextBoxCaseNo1.Text); errors here => CS0117: casefile does not get a definition for 'getCaseId'
}
}
}
Thanks,
tinac99