Question Calling SQL Function for column in Datagrid

paris_tj

New member
Joined
Jun 14, 2021
Messages
1
Programming Experience
3-5
I have this...
C#:
this.dgLeads.Columns.Add(new GridTextColumn()
                         {
                             MappingName = "idLeadStatus",
                             HeaderText = "Status",
                             Width = 100
                         });
I need it to be something like this....
C#:
this.dgLeads.Columns.Add(new GridTextColumn()
                         {
                             MappingName = f_GetLeadStatusByID("idLeadStatus"),
                             HeaderText = "Status",
                             Width = 100
                         });
I'm new to C# and this has me very confused. I am using LINQ and the "f_GetLeadStatusByID" is a SQL Function.

Thanks
D
 
Last edited by a moderator:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,903
Location
Sydney, Australia
Programming Experience
10+
When you say that you're using LINQ, do you specifically mean that you're using LINQ to SQL as your data access technology? LINQ is a broader subject - a query technology with native language support - and you're not using it in that code. LINQ to SQL is a specific LINQ provider for querying SQL Server data sources. If that's what you mean then this isn't really a LINQ question because it's not really about querying data using LINQ. It's more of a SQL Server question, in which case I'll move this thread.
 

NoUserHere

Well-known member
Joined
Sep 5, 2018
Messages
2,138
Programming Experience
10+
Show us where f_GetLeadStatusByID is defined? Because it's not a Sql function, well not one I've ever seen.

You also neglected to ask a question. And I think you need to put a bit more effort into explaining what it is you are doing or trying to do and why.
 
Top Bottom