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

  • SEARCH
  • Home
  • 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 8145505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:40:59+00:00 2026-06-06T13:40:59+00:00

According to http://msdn.microsoft.com/en-us/library/ms810291.aspx , you can’t change the ReadOnly attribute of an Expression based

  • 0

According to http://msdn.microsoft.com/en-us/library/ms810291.aspx, you can’t change the ReadOnly attribute of an Expression based column in your DataTable. I need to figure out a way to Evaluation the Expression on a DataTable column, then set the .Expression = null, then allow the editing of that Column:

The following code does not work, because when you set the Expression == null, it resets the value in the DataTable to DBNull:

_persistedDataTable.Columns[currentDataColumn.ColumnName].Expression = null;
_persistedDataTable.Columns[currentDataColumn.ColumnName].ReadOnly = false;

My idea is that i copy the current DataTable to a new DataTable, row by row without preserving the schema, allowing me to edit the new DataTable values (whether or not they were derived by Expressions or not)… I am just not sure how to do this.

  • 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-06T13:41:00+00:00Added an answer on June 6, 2026 at 1:41 pm

    Here is how i did it:

    String dateFilter = "IIF([data_type] = 'smalldatetime', 'true!', '')";
                String targetFilter = "[source_field]"; 
    
                DataTable tempDataTable = new DataTable();
    
                //create fields field
                DataColumn order = new DataColumn("order", Type.GetType("System.Int32"));
                tempDataTable.Columns.Add(order);
                order.AutoIncrement = true;
                order.AutoIncrementSeed = 1;
                order.ReadOnly = false;
    
                _sourceDataAdapter.Fill(tempDataTable);
                tempDataTable.Columns.Add(new DataColumn("date_format", Type.GetType("System.String"), dateFilter));
                tempDataTable.Columns.Add(new DataColumn("target_field", Type.GetType("System.String"), targetFilter));
    
                tempDataTable.BeginInit();
                tempDataTable.EndInit();
    
                _dataTable.Columns.Add(new DataColumn("order", Type.GetType("System.Int32")));
                _dataTable.Columns.Add(new DataColumn("local_field", Type.GetType("System.String")));
                _dataTable.Columns.Add(new DataColumn("length", Type.GetType("System.Int32")));
                _dataTable.Columns.Add(new DataColumn("data_type", Type.GetType("System.String")));
                _dataTable.Columns.Add(new DataColumn("decimals", Type.GetType("System.Int32")));
    
                _dataTable.Columns.Add(new DataColumn("date_format", Type.GetType("System.String")));
                _dataTable.Columns.Add(new DataColumn("target_field", Type.GetType("System.String")));
    
                using (DataTableReader reader = tempDataTable.CreateDataReader())
                {
                    while(reader.Read())
                    {
                        if (reader.HasRows)
                        {
                            _dataTable.Rows.Add(reader.GetValue(0), reader.GetValue(1), reader.GetValue(2), reader.GetValue(3), reader.GetValue(4), reader.GetValue(5), reader.GetValue(6));
                        }
                    }
                }
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this http://msdn.microsoft.com/en-us/library/cc849094(v=vs.85).aspx#OptInHighDPI you can make your web browser control use IE8-style zooming,
According to the docs: http://msdn.microsoft.com/en-us/library/x13ttww7.aspx : The volatile keyword can be applied to reference
According to MSDN I can have an OnClick for a LinkButton --> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linkbutton.onclick(v=VS.90).aspx However,
According to http://msdn.microsoft.com/en-us/library/9ekhdcxs(v=vs.80).aspx , C2079 can also occur if you attempt to declare an
According to MSDN ( http://msdn.microsoft.com/en-us/library/system.windows.forms.label.autosize.aspx ), there's a note about Label 's AutoSize property:
I'm using ICommandText::GetCommandText method. According to the MSDN documentation ( http://msdn.microsoft.com/en-us/library/ms709825(v=VS.85).aspx ) I need
According to the MSDN documentation ( http://msdn.microsoft.com/en-us/library/ms172987.aspx ), the My.Application.Log property is used to
According to : http://msdn.microsoft.com/en-us/library/ms175061.aspx It says that the NOT LIKE relational operator : Specifies
According to http://msdn.microsoft.com/en-us/library/ms687032%28v=vs.85%29.aspx , WaitForSingleObject() has undefined behavior if a handle gets closed while
Registered my program according to http://msdn.microsoft.com/en-us/library/aa767914.aspx . The association seems to be working, because

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.