"undefined function call" when using a function in a DataSet

I have a DataSet in UserAdmin.xsd with many DataTable s. Most data comes directly from stored procedures. However, for one of the tables, I would like to add another column that uses the C # function defined in another file.

I put for the expression for this column: Helper.ObtainUserInfo(user_nm, "displayname"); but this gives me the error "undefined function call".

Helper.cs is under App_Code/Common/ , and the namespace is COM.ABC . UserAdmin.xsd is under App_Code/ .

How can I access the ObtainUserInfo() function? Is there something like the using keyword that I could use?

+4
source share
2 answers

You cannot use DataColumn.Expression to call a .NET method to get a value. To calculate the value, you must specify a column in this table or one of the parent / child tables. For more information on what you can do (t) with Expressions , see here: http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression%28v=VS.100 % 29.aspx

Instead of using a method or expression, I would recommend doing this with SQL whenever possible.

+1
source

If you provide your code, then it would be very useful to solve your problem, anyway, if you have a problem with your solution, I hope this can help you

You can open the code file that contains the ObtainUserInfo () function, then you can view this class name in another file. For example, if you have a solution Named WebApplication1, inside which, if you have a user class, the ObtainUserinfo () function is defined in this user class, then you should use such an operator,

Using WebApplication1.Users

0
source

All Articles