dcsimg
Results 1 to 4 of 4

Thread: How to get English text of label from database based on table reference and field nam

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    64

    How to get English text of label from database based on table reference and field nam

    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

    Code:
    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 ?

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    102,759

    Re: How to get English text of label from database based on table reference and field

    So, you're asking us how to perform a query with a Where clause using EF?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    64

    Re: How to get English text of label from database based on table reference and field

    yes view or function to display text of every label from database based on field name and table name
    please if you can help me on that
    suppose i open items view what i need to display
    label text from reference table for item code as ItemCodeVal
    label text from reference table for ItemName as ItemNameVal

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    102,759

    Re: How to get English text of label from database based on table reference and field

    It's just a regular old query, so you should learn how to execute a query. You might want to start with the Database FAQ link in my signature or the VB tutorial link, which covers the basics of data access along with the rest of the language. Once you have the result, you can display it like you would any other text. Once you've read up and made an attempt, you can always post back here if it doesn't work and we can help you fix it. You should be able to make that attempt first though.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width