Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8842565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:59:24+00:00 2026-06-14T10:59:24+00:00

In my sql database I have a numeric(3,2) field that I want to bind

  • 0

In my sql database I have a numeric(3,2) field that I want to bind to a textbox. When Linq to SQL brings in the field, it converts the field to a decimal on its linq object. Is it possible to access numeric precision and scale so I can use them in validation or binding in the case of a custom control? Eventually I would like to prevent the user from entering in more than two decimal points on the UI Side.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:59:26+00:00Added an answer on June 14, 2026 at 10:59 am

    I found you can do something like this

            string val = String.Empty;
    
            Type t = obj.GetType();
            PropertyInfo prop = t.GetProperty(fieldName);
            object[] info = prop.GetCustomAttributes(typeof(ColumnAttribute), true);
    
            if (info.Length == 1)
            {
                ColumnAttribute ca = (ColumnAttribute)info[0];
                string attr = ca.DbType
                                //... parse attr to get the info you want
            }
    
            return val;
    

    It is not ideal because you have to parse out a string to get what I’m looking for. But it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in the sql server database I have a field that is type numeric. Precision
I have a numeric database field (numeric(3) in SQL Server 2000) that allows nulls,
I have a SQL database that has a table with a field set to
I have a column in a SQL server database that stores numeric values. The
We have a SQL Server database table that consists of user id, some numeric
I have a numeric field in my Oracle database that represents the number of
I have a varchar field in a SQL Server database that stores phone numbers
In my SQL database I have a column that contains a fiscal year value.
In my SQL database I have a query that turns values in multiple rows
I have a Sql Database (which I have no control over the schema) that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.