I found another way..
I made a Stored Procedure to get what I needed and then call it.
USE [Table]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE Custom_GetNotesList(@LexCodeId int)
AS
BEGIN
Select LexCodeNodeId, Note, Active
From LexCodeNote
Where LexCodeNodeId in (
Select LexCodeNodeId
From LexCodeNode
where LexCodeId = @LexCodeId)
END
Here is how I call it.
private void GetNotesList(int Id, int Page)
{
DataAccess.LexCodeNode LexCodeNode = new DataAccess.LexCodeNode();
LexCodeNode.GetNotesList(Id);
BindGrid(DgNoteLst, LexCodeNode.DefaultView);
}
And the definition in the DataAccess Segment
public bool GetNotesList(int pLexCodeId)
{
ListDictionary parameters = new ListDictionary();
parameters.Add(Parameters.LexCodeId, pLexCodeId);
return base.LoadFromSql("[" + this.SchemaStoredProcedure + "Custom_GetNotesList]", parameters);
}