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 8449345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:40:42+00:00 2026-06-10T10:40:42+00:00

I have this code to retrieve data from a datagrid and then store then

  • 0

I have this code to retrieve data from a datagrid and then store then in another datatable. But I am getting the exception as:
"Unable to cast object of type 'MS.Internal.NamedObject' to type 'System.Data.DataRowView'.” This exception comes after "dt.Rows.Add(dr.ItemArray)"

Please do let me know if there are any faults, or any additional information is needed.

Code:

 DataTable dt = new DataTable();
         DataColumn c1 = new DataColumn("IsActive", typeof(bool));
         dt.Columns.Add(c1);

         DataColumn c2 = new DataColumn("DataGridTextBox_QCList1", typeof(string));
         c2.MaxLength = 500;
         dt.Columns.Add(c2);

         DataColumn c3 = new DataColumn("DataGridTextBox_QCSummary", typeof(string));
         c3.MaxLength = 500;
         dt.Columns.Add(c3);

         DataColumn c4 = new DataColumn("DataGridComboxBox_Control", typeof(string));
         c4.MaxLength = 500;
         dt.Columns.Add(c4);  

     foreach (DataRowView d in dtgQCNumbers.Items)
     {
    DataRow dr = d.Row;
    dt.Rows.Add(dr.ItemArray);
    dt.AcceptChanges();
     }
     foreach (DataRow row in dt.Rows)
     {
    qcId = row["QC_ID"].ToString();
    zipFolderPath = baseFolderPath;
    patternFiles = Directory.GetFiles(zipFolderPath, "*.zip");

    logMessage = "Unzipping file from path" + zipFolderPath + " \n file name:" + patternFiles[0];
    Common.LogMessage(logMessage);

    UnZipReleasePatch(zipFolderPath, patternFiles.First());
    //deploy release patch.
    logMessage = "Deploying files" + zipFolderPath;
    Common.LogMessage(logMessage);
    DeployFiles();
}
  • 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-10T10:40:44+00:00Added an answer on June 10, 2026 at 10:40 am

    Thanks to AVD, got my answer as follows:

    foreach (DataRow d in _ds.Tables[0].Rows)
             {
                 if (d["DataGridComboxBox_Control"].ToString() == "AVS_DB")
                 {
                     qcId = d["DataGridTextBox_QCList1"].ToString();
                     zipFolderPath = baseFolderPath;
                     patternFiles = Directory.GetFiles(zipFolderPath, "*.zip");
    
                     logMessage = "Unzipping file from path" + zipFolderPath + " \n file name:" + patternFiles[0];
                     Common.LogMessage(logMessage);
    
                     UnZipReleasePatch(zipFolderPath, patternFiles.First());
                     logMessage = "Deploying files" + zipFolderPath;
                     Common.LogMessage(logMessage);
                     DeployFiles();
                 }
             }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to retrieve data from file then make some treatment, and
I have code to retrieve data from a database into a form but it
I have this code to display the data retrieved from DB in accounts_view.php :
If you have to retrieve data from a database and bring this dataset to
Hello I have the following code to retrieve data from my db using nhibernate
I have tried to use the following code to retrieve the data from the
I have an requirement of store and retrieve data from isolated storage file.I will
I have this code from another post : SELECT bar FROM (SELECT S.subcategoryname As
PROBLEM So, I have this function to retrieve and proceed data from $_REQUEST, $_POST,
i have this code, which helps me to retrieve all table fields and associate

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.