Main Page | Report this Page
.NET DotNet Forum Index  »  Visual C# Forum  »  Best way to insert Rich TextBox...
Page 1 of 1    

Best way to insert Rich TextBox...

Author Message
Ed Hochberg...
Posted: Wed Oct 28, 2009 1:14 pm
Guest
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?
 
Peter Duniho...
Posted: Wed Oct 28, 2009 1:29 pm
Guest
Ed Hochberg wrote:
Quote:
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
 
Scott M....
Posted: Wed Oct 28, 2009 3:38 pm
Guest
"Ed Hochberg" <EdHochberg at (no spam) discussions.microsoft.com> wrote in message
news:A7890860-E20C-4FF3-85C0-5B7B846F0EB5 at (no spam) microsoft.com...
Quote:
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
 
Ed Hochberg...
Posted: Wed Oct 28, 2009 4:07 pm
Guest
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.

"Peter Duniho" wrote:

Quote:
Ed Hochberg wrote:
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
.
 
Scott M....
Posted: Wed Oct 28, 2009 5:22 pm
Guest
"Ed Hochberg" <EdHochberg at (no spam) discussions.microsoft.com> wrote in message
news:1878C4D7-7FD4-4888-867A-9C31C6FE4117 at (no spam) microsoft.com...
Quote:
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
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Mon Nov 23, 2009 2:43 pm