Quote:
quote:Originally posted by mame37
Ti spiego meglio quello che devo fare: devo creare un programma console dato una tabella .csv contenente 4 colonne e 5000 righe contenenti dei contatti..io devo prendere da questa tabella tramite c#sola la prima colonna e che rappresenta l'username e la quarta colonna che rappresenta la password per poi inviarli a un dato database..prima di inviare questi dati al database però io devo aggiungere a tutti i dati della colonna 1 ovvero gli username la dicitura ..@alice.it e poi procedere all'invio.. te ne sarei molto grato visto ke mi trovo in alto mare e nn so dove mettere le mani...grazie ancora x l'aiuto..ciao
|
Well it's a long time since I spoke Italian with any confidence but:
***********************************
I'll try to explain what I'm attempting: I need a console application that reads a CSV having 4 columns and 5000 rows, the first column is the username, the fourth the password. I need to add the email suffix @alice.it to the username and send the details to a database using C#. I find myself adrift on the high seas [may have misconstrued that] and appreciate your help, thanks etc.
*********************************************
Okay so I would attempt this in the following stages:
- Read the file using TextReader and StreamReader: http://www.csharp-station.com/HowTo/...eTextFile.aspx
- use String.Split to get an array representing the columns
- Add the suffix to the first column
- Pass the data to the database, you can use a stored procedure or SQL but you'll have to give more information. Is it a new table, an existing one etc?
--
Joe (
Microsoft MVP - XML)