Best way to insert Rich TextBox

E

Ed Hochberg

Hi all,

I want to add records to a Mysql database using a 2 step approach. First
write to a text file (either comma or space delimited). From there loop
through the records and insert them into the database. My question is, for a
larger field like a Rich TextBox, that will say contain over 200 chars does
the above approach sound resoanable? A record in the text file will be quite
wide this way (not saying it matters). Can you think of a better approach?
 
P

Peter Duniho

Ed said:
Hi all,

I want to add records to a Mysql database using a 2 step approach. First
write to a text file (either comma or space delimited). From there loop
through the records and insert them into the database. My question is, for a
larger field like a Rich TextBox, that will say contain over 200 chars does
the above approach sound resoanable? A record in the text file will be quite
wide this way (not saying it matters). Can you think of a better approach?

What is the point of writing to a file first?

Unless you can explain _why_ you're doing it a specific way, it's not
really possible to know whether that in fact is the best way. Solely
from your description, there's no reason to believe that simply adding
the data directly to the database isn't the best way, and that writing
to a file that you're just going to read from again is a waste of time.

As far as the specific question, I don't see why the amount of data in a
particular field/column would be of particular concern. A comma- or
space-delimited file will of course have complications if you expect to
save text fields that themselves may contain commas or spaces. But the
specific _length_ of the field shouldn't be an issue per se. It's not
like the file system cares how many characters you have between newline
characters.

Pete
 
S

Scott M.

Ed Hochberg said:
Hi all,

I want to add records to a Mysql database using a 2 step approach.
First
write to a text file (either comma or space delimited). From there loop
through the records and insert them into the database. My question is,
for a
larger field like a Rich TextBox, that will say contain over 200 chars
does
the above approach sound resoanable? A record in the text file will be
quite
wide this way (not saying it matters). Can you think of a better
approach?

Why are you using the 2 step approach in the first place? Unless you can
give a really good reason why you are doing that, I would say this is not a
good approach at all.

Grabbing 200 chars. from an input field (RTB or whatever) isn't a big deal
as long as the database column is set up to take data that long.

-Scott
 
E

Ed Hochberg

Thanks Peter,

I am doing it this way because I am creating a data entry program and I want
it to work on someones PC that doesn't have the Database installed. This way
they write to a txt file and can easily email it to me. Then I can enter it
into the database.
 
S

Scott M.

Ed Hochberg said:
Thanks Peter,

I am doing it this way because I am creating a data entry program and I
want
it to work on someones PC that doesn't have the Database installed. This
way
they write to a txt file and can easily email it to me. Then I can enter
it
into the database.

If you have access to an SMTP Server, why don't you just have the program
email the data to you?

Or, post the database online and have the program send the data straight to
the database?

-Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top