Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Problem with DataGridView Update not accepting all the data from a richtextbox

$
0
0

I am having a slight problem with adding a new row of data from several textbox fields and a richtextbox field. Everything works fine except for that if I have a large amount of data in my richtextbox not all the data is updated.

The program is written in C#

The data is being updated to an Access Database.

The column in the Access Data Table is formatted as Memo.

The column in the Visual Studio Data Designer is formatted as System.String with a MaxLength of 536870910.

InsertQueryTask is:

INSERT INTO Task

                        (TaskNumber, TaskDescription, TypeCode, Instructions)

VALUES        (?, ?, ?, ?)

This is from the property from the Query Builder from Visual Studio

Param1 (DbType.Double), Param2 (DbType.StringFixedLength(255)), Param3 (DbType.StringFixedLength(255)), Param4 (DbType.StringFixedLength)

Everything works fine except with updating from the Rich Text Box.

If you paste a large amount of text into the Rich Text Box say, 10,000 characters and update the data base with a button click only about 986 characters are inputted into the new row under the Instruction Column.  

Part of the code is:

PAdbDataSet.TaskRow newTaskRow = pAdbDataSet.Task.NewTaskRow();

               newTaskRow.TaskNumber = Convert.ToInt32(txtTaskNumber.Text);

               newTaskRow.TaskDescription = txtPaDescription.Text.ToString();

               newTaskRow.TypeCode = comboBox1.ValueMember.ToString();

               newTaskRow.Instructions = rtbInstruction.Text.ToString();

               PAdbDataSet.Task.Rows.Add(newTaskRow);

               taskTableAdapter.InsertQueryTask

                   (Convert.ToInt32(txtTaskNumber.Text),

                   txtPaDescription.Text.ToString(),

                   comboBox1.SelectedValue.ToString(),

                   rtbInstruction.Text.ToString());

               Update();

                PAdbDataSet.AcceptChanges();


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>