Click here to Skip to main content
16,012,821 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hide application from process list? Pin
Mike Poz26-Jun-06 13:08
Mike Poz26-Jun-06 13:08 
GeneralRe: Hide application from process list? Pin
CodeLeon26-Jun-06 14:34
CodeLeon26-Jun-06 14:34 
GeneralRe: Hide application from process list? Pin
BoneSoft26-Jun-06 14:42
BoneSoft26-Jun-06 14:42 
GeneralRe: Hide application from process list? Pin
Jun Du26-Jun-06 14:02
Jun Du26-Jun-06 14:02 
GeneralRe: Hide application from process list? Pin
Dave Kreskowiak26-Jun-06 17:41
mveDave Kreskowiak26-Jun-06 17:41 
QuestionGet Attribute Fuction Pin
Pantelis1326-Jun-06 7:30
Pantelis1326-Jun-06 7:30 
AnswerRe: Get Attribute Fuction Pin
Not Active26-Jun-06 8:26
mentorNot Active26-Jun-06 8:26 
QuestionHelp with textfile loop Pin
giulione26-Jun-06 7:26
giulione26-Jun-06 7:26 
Hi,
i have this text file

GENUARDI ADOLFO

90100

04800530828

VIA ORETO139

MARCHESE SALVATORE

90100

00464940824

IAZZA CARMINE 40

I must read 4 line each time and put into a database so till the end of the document,
i wrote this code but is not right


try

{


StreamReader sr=new StreamReader("\\Program Files\\SIP\\clienti.txt");


string[] After;


ArrayList lines = new ArrayList();

string line;

int lineb=0;

int conta=0;

while ((line = sr.ReadLine()) != null)

lines.Add(line);


if(conta % 4==0)

{


string a = (string) lines[0];

string b = (string) lines[1];

string c = (string) lines[2];

string d = (string) lines[3];

SqlCeConnection cn = new SqlCeConnection("Data Source=\\Program Files\\SIP\\data.sdf");

cn.Open();

string gg="INSERT INTO clienti(nome,CAP,piva,Indirizzo) VALUES('"+a.ToString()+"','"+b.ToString()+"','"+c.ToString()+"','"+d.ToString()+"')";

SqlCeCommand cmd = new SqlCeCommand(gg,cn);

cmd.ExecuteNonQuery();

cn.Close();

cont++;

}






}

catch(SqlCeException ex)

{

MessageBox.Show("Errore"+ex.Message+ex.Errors);

}
Please help me Bye


giulio
AnswerRe: Help with textfile loop Pin
Stefan Troschuetz26-Jun-06 7:38
Stefan Troschuetz26-Jun-06 7:38 
AnswerRe: Help with textfile loop Pin
Guffa26-Jun-06 7:52
Guffa26-Jun-06 7:52 
QuestionHow can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
AngryC26-Jun-06 6:29
AngryC26-Jun-06 6:29 
AnswerRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
Judah Gabriel Himango26-Jun-06 7:23
sponsorJudah Gabriel Himango26-Jun-06 7:23 
GeneralRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
AngryC26-Jun-06 7:49
AngryC26-Jun-06 7:49 
GeneralRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
Nader Elshehabi26-Jun-06 8:08
Nader Elshehabi26-Jun-06 8:08 
GeneralRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
AngryC26-Jun-06 12:08
AngryC26-Jun-06 12:08 
GeneralRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
Nader Elshehabi26-Jun-06 13:21
Nader Elshehabi26-Jun-06 13:21 
QuestionFree open source Rich Text Editor Pin
NaNg1524126-Jun-06 5:31
NaNg1524126-Jun-06 5:31 
AnswerRe: Free open source Rich Text Editor Pin
Steve Maier26-Jun-06 5:58
professionalSteve Maier26-Jun-06 5:58 
AnswerRe: Free open source Rich Text Editor Pin
J4amieC26-Jun-06 6:06
J4amieC26-Jun-06 6:06 
AnswerRe: Free open source Rich Text Editor Pin
Graham Nimbley26-Jun-06 8:42
Graham Nimbley26-Jun-06 8:42 
QuestionUrgent Pin
Shiv526-Jun-06 5:19
Shiv526-Jun-06 5:19 
AnswerRe: Urgent Pin
J4amieC26-Jun-06 5:34
J4amieC26-Jun-06 5:34 
AnswerRe: Urgent Pin
Judah Gabriel Himango26-Jun-06 5:52
sponsorJudah Gabriel Himango26-Jun-06 5:52 
AnswerRe: Urgent Pin
Colin Angus Mackay26-Jun-06 5:58
Colin Angus Mackay26-Jun-06 5:58 
AnswerRe: Urgent Pin
Jun Du26-Jun-06 6:03
Jun Du26-Jun-06 6:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.