text flies Flashcards

(10 cards)

1
Q

What is data persistence?

A

Making data available beyond program execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

One way to persist data besides text files?

A

Use a database (e.g., SQL Server, MySQL).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Disadvantage of text files for persistence?

A

Difficult to identify field boundaries due to variable length.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to overcome variable length field issue?

A

Use delimiters like , or |.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does CSV stand for?

A

Comma Separated Values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you read a file in C#?

A

File.ReadAllText(“filename.txt”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you write to a file in C#?

A

File.WriteAllText(“filename.txt”, data);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you append to a text file?

A

File.AppendAllText(“filename.txt”, data);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a stream?

A

A flow of data used to read/write files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why use using for file I/O?

A

Ensures automatic disposal of resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly