Click here to Skip to main content
15,906,097 members
Home / Discussions / C#
   

C#

 
QuestionEnable/Disable DataGridViewCell Pin
half-life5-Apr-09 23:09
half-life5-Apr-09 23:09 
AnswerRe: Enable/Disable DataGridViewCell Pin
Michael Bookatz5-Apr-09 23:38
Michael Bookatz5-Apr-09 23:38 
GeneralRe: Enable/Disable DataGridViewCell Pin
half-life6-Apr-09 0:30
half-life6-Apr-09 0:30 
AnswerRe: Enable/Disable DataGridViewCell Pin
Henry Minute6-Apr-09 1:43
Henry Minute6-Apr-09 1:43 
GeneralRe: Enable/Disable DataGridViewCell Pin
half-life6-Apr-09 1:55
half-life6-Apr-09 1:55 
QuestionParser Error Message: Could not load type '_Default'. [urgent help] Pin
Yosh_5-Apr-09 23:02
professionalYosh_5-Apr-09 23:02 
AnswerRe: Parser Error Message: Could not load type '_Default'. [urgent help] Pin
Vikram A Punathambekar5-Apr-09 23:17
Vikram A Punathambekar5-Apr-09 23:17 
QuestionPlease Help Me!!! Pin
crrajaguru5-Apr-09 22:54
crrajaguru5-Apr-09 22:54 
AnswerRe: Please Help Me!!! Pin
Blue_Boy5-Apr-09 23:13
Blue_Boy5-Apr-09 23:13 
GeneralRe: Please Help Me!!! Pin
crrajaguru5-Apr-09 23:22
crrajaguru5-Apr-09 23:22 
AnswerRe: Please Help Me!!! Pin
Colin Angus Mackay6-Apr-09 0:14
Colin Angus Mackay6-Apr-09 0:14 
QuestionDigital clock for windows appliction Pin
Ch.Gayatri Subudhi5-Apr-09 22:42
Ch.Gayatri Subudhi5-Apr-09 22:42 
AnswerRe: Digital clock for windows appliction Pin
DaveyM695-Apr-09 23:00
professionalDaveyM695-Apr-09 23:00 
GeneralRe: Digital clock for windows appliction Pin
Ch.Gayatri Subudhi6-Apr-09 17:54
Ch.Gayatri Subudhi6-Apr-09 17:54 
AnswerRe: Digital clock for windows appliction Pin
crrajaguru5-Apr-09 23:01
crrajaguru5-Apr-09 23:01 
AnswerRe: Digital clock for windows appliction Pin
akhilonly0075-Apr-09 23:17
akhilonly0075-Apr-09 23:17 
GeneralRe: Digital clock for windows appliction Pin
Ch.Gayatri Subudhi6-Apr-09 18:03
Ch.Gayatri Subudhi6-Apr-09 18:03 
QuestionHow to generate specific barcodes like KOELLIKER, OMR4, NEOPOST B, OMR... Pin
tom5720075-Apr-09 22:40
tom5720075-Apr-09 22:40 
RantRe: How to generate specific barcodes like KOELLIKER, OMR4, NEOPOST B, OMR... Pin
tom5720076-Apr-09 5:31
tom5720076-Apr-09 5:31 
QuestionMultiple selection Pin
Megidolaon5-Apr-09 22:08
Megidolaon5-Apr-09 22:08 
AnswerRe: Multiple selection Pin
King Julien6-Apr-09 0:01
King Julien6-Apr-09 0:01 
QuestionHow to save file content that some contains same lines into the database? Pin
Nopo5-Apr-09 22:08
Nopo5-Apr-09 22:08 
Hi all,

Can you please help me out or advice on how to solve the following problem.

I'm reading files line by line from a folder and I'm saving the file content into the database. Now, my problem is that some of the lines from the file are the same. I can read the first line and when I reach the other line that has the same name as that first line my 'line' variable becomes empty and nothing got saved in the database (for only those lines that are the same). I need to save all the content of the file into the database, even those lines that are the same (numbering and heading).

my file looks like this (taken some content of the file)

1. This Report Concerns :
an individual

2. Surname :
Nkwanyana

3. First Name :
Nonti

4. Other Initials :
Z

5. Identifying number :
7200506586321

6. Type of Identifier :
_ID Book

7. Country of Residence :
South Africa

1. Transaction was conducted by :
the person referred to in Part D

2. Surname :
Phungo

3. First Name :
Hendrica

4. Other Initials :
M

5. Identifying number :
8695421345789

6. Type of Identifier :
ID book

7. Is there a photograph or other image of the person available?
NO

my code looks like:

if (line != null && line.Contains("2. Surname :"))
{
line = reader.ReadLine();
Surname = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("3. First Name :"))
{
line = reader.ReadLine();
FirstName = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("4. Other Initials :"))
{
line = reader.ReadLine();
OtherInitials = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("5. Identifying number :"))
{
line = reader.ReadLine();
IdentifyingNumber = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("6. Type of Identifier :"))
{
line = reader.ReadLine();
TypeOfIdentifier = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("7. Country of Residence :"))
{
line = reader.ReadLine();
CountryOfResidence = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("2. Surname :"))
{
line = reader.ReadLine();
SecSurname = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("3. First Name :"))
{
line = reader.ReadLine();
SecFirstName = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("4. Other Initials :"))
{
line = reader.ReadLine();
SecOtherInitials = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("5. Identifying number :"))
{
line = reader.ReadLine();
SecIdentifyingNumber = line;
line = reader.ReadLine();
}
if (line != null && line.Contains("6. Type of Identifier :"))
{
line = reader.ReadLine();
SecTypeOfIdentifier = line;
line = reader.ReadLine();
}

Will really appreciate your help.

Thanks.
AnswerRe: How to save file content that some contains same lines into the database? Pin
SeMartens5-Apr-09 22:20
SeMartens5-Apr-09 22:20 
GeneralRe: How to save file content that some contains same lines into the database? Pin
Nopo5-Apr-09 22:28
Nopo5-Apr-09 22:28 
GeneralRe: How to save file content that some contains same lines into the database? Pin
SeMartens5-Apr-09 22:42
SeMartens5-Apr-09 22:42 

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.