rama lakshmi

rama lakshmi

  • NA
  • 4
  • 2.8k

how to write data to a text file

Mar 15 2016 2:00 AM
how to write data to a text file with overwrite the current data in c# with using loops

Answers (1)

0
Rousseau Sennett

Rousseau Sennett

  • 0
  • 31
  • 44k
May 20 2011 10:28 AM
I found the solution it was probably my lack of Knowledge about the UNION and I didn't realise you can have NULLS because union requires both selects to be the same and in the same order anyway my simple query looks like this

SELECT        Date, Total AS Debit, NULL AS Credit, InvoiceNum
FROM            Invoice
UNION ALL
SELECT        Date, NULL AS Expr1, Amount, NULL AS Expr2
FROM            Credits

Just replaced with NULLS since both tables didn't have the same fields
0
Mahesh Chand

Mahesh Chand

  • 1
  • 270.3k
  • 240.7m
May 20 2011 10:14 AM
SQL query solution is recommended. But if you can't do in SQL, 

you could create a DataTable with the columns you want and then get wanted rows from your other two databases using ImportRow.

Just a thought.