Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
How to get English text of label from database based on table reference and field name as dynamic...

I make project in SQL server 2012 asp.net core 2.1 visualstudio2017 and technology i

using entity framework core 2.1 .

what I need is to get text of label control from database based on table name and

field name from reference table .

so that i need to make function can be used to get the label text when table fields

match what exist on reference file based on table and field name .

so that How to do that ?

to more explain what i need see this example

suppose i have item table and product table

Item table have two fields
Item Code
Item Name
Product table have two fields
Product No
Product Name
reference table have 5 fields

C#
serial tablename fieldname   ArabictextforLabel EnglishtextforLabel 
1        Item      ItemCode         كود الصنف              ItemCodeVal
2        Item      ItemName         اسم الصنف              ItemNameVal        
3        Product   ProductNo        كود المنتج              ProductNoVal
4        Product   ProductName      اسم المنتج              ProductNameVal


so that when go to view Items

get text for labeles as (ItemCodeval then display itemnameval) for viewmodels for items

and same thing on product view display label text as ( productnoval and

productnameval) for view model Products

and when this text for product table and items table changed this will changed on view as dynamically .

this will make dynamically show text per labels

Can this available on asp.net core 2.1 entity framework core 2.1 or not and how to do it if allowed ?

What I have tried:

How to get English text of label from database based on table reference and field name as dynamically
Posted
Updated 22-Dec-18 12:06pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900