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 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
  • 4 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

Related Questions

I have a .NET console app that reads info from a USB stick and
I have a complex database conversion console app that reads from an old database,
I have a console app that opens an oleDBConnection to access some data from
I have a console app that needs to connect to a remote sql server
I have a console app on the server that I need to run between
I have a console app (written in c#) that is passed various arguments from
i have a console app in c# that extracts 20 fields from an oracle
Have simple C# console app which imports text data into SQL. It takes around
I have a java console app that I'm writing, and I want people to
I have a WCF library project that I reference from a console app. The

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.