954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

DataAdapter.Update in C# to MS-Access does not update Multiline Text Box Memo Fields

Urgent Help needed,

I am updating an access database using C#. Everything works fine except when there are multlines in text box controls, update command doesnot update these textboxes to text field or memo field. On screen I have a grid from the same datasource as that of the textbox where the change is reflected an appears in multi lines. On updation the text boxes with multiline is not updating the fields. If its a single line on these fields it gets updated.
I use oledb dataadapter, datasource and dataview and updation is done by calling the


DataTable ds3 = myDataSet.Tables["Listing"].GetChanges(DataRowState.Modified);

myDataAdapter2.UpdateCommand = myCommandBuilder2.GetUpdateCommand();

if (ds3 !=null)
{
myDataAdapter2.Update(ds3);
ds3.Dispose();
}
DataAdapter2.Update

Thanx
Aroop

aroopv
Newbie Poster
2 posts since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

Upload a sample project demonstrating this behavior

sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
 
Upload a sample project demonstrating this behavior

Dear sknake,

Thank you very much for your prompt reply, I have found out the issue. Since you wanted a sample, I just thought to have second check, it was discovered that

after changing the field if I move to another record and press update it was working fine. So I changed my code to move to last record the UPDATE command, again back to modified record.
I dont know whether this is the right way, but it works.

Thanx once again

aroopv
Newbie Poster
2 posts since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

It sounds like you're not calling .BeginEdit() and .EndEdit() on the row while you're updating it -- and moving the row cursor does that for you under the hood. Try it and see if that fixes your issue.

Please mark this thread as solved since you have found the answer to your original problem and good luck!

sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You