I have created an MS Access Query named GetContactCategory
select GetCategoryNames(contactId) as CategoryNames from Contacts
The Function GetCategoryNames is the function written in a module of same database.
Now when i call this query in my c# application using ADO.net it throws error.
Following is my c# code
`
using (OleDbCommand cm = new OleDbCommand())
{
cm.Connection = AccessConnection();
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "GetContactCategory";
cm.Connection.Open();
using (OleDbDataReader reader = cm.ExecuteReader())//This line throws error
{
//some code
}
}
`
The error which is get Undefined function 'GetCategoryNames' in expression.
what is the problem and whats the solution.