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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:26:26+00:00 2026-05-10T17:26:26+00:00

I have a C# console app App1 that reads a row of data from

  • 0

I have a C# console app ‘App1’ that reads a row of data from a table in a SQL Server 2005 DB. I want App1 to pass all the data in this row to App2, another C# console app. What is the best way to do this?

My first (naive) attempt was to do this:

object[] o = myrow.ItemArray; // make a string that separates each item by a space... for example '1 2 myVar'. // pass this string to App2 via command line. 

This has some flaws: what if one of the entries in the row was ‘my var’ instead of ‘myVar’? Also, the order of the items would be hardcoded in the receiving app (App2).

So what’s the best way to do this? Would it be appropriate to pass an xml string to App2 via command line?

Cheers!

  • 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. 2026-05-10T17:26:27+00:00Added an answer on May 10, 2026 at 5:26 pm

    One approach would be to serialize the row to XML and use that, except that DataRow (lacking a default constructor) can’t be serialized. Instead you’d have to create a new DataTable and add that row to it.

    Then you could simply serialize the entire DataTable to XML and pass it to the other application, either as a command-line argument or by saving the XML to a file and passing the filename.

    Serializing a DataTable to XML is quite trivial thanks to the DataTable.WriteXml method.

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

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer As mentioned by Outlaw Programmer, I think the solution is… May 11, 2026 at 10:05 am
  • added an answer If all you need to automatize is related to browsers,… May 11, 2026 at 10:05 am
  • added an answer You could make a country class, and using object composition,… May 11, 2026 at 10:05 am

Related Questions

I have a C# console app App1 that reads a row of data from
I have a C# class library and a startup project (a console app). The
This is a C# console application. I have a function that does something like
I have a basic C# console application that reads a text file (CSV format)
I have a little c# console program that outputs some text using Console.WriteLine. I
I have a C# project building winexe that startup without console window. However, I
I have a C#/.NET program that can run both as a console application and
I have a console program written in C# that I am using to send
I have a console application project in C# 2.0 that needs to write something
I have an .net C# console application (not a service). it basically connects to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.