Answered by:
dbtype for access memo field using accessdatasource?

Question
-
User-442518976 posted
I'm writing a couple simple ASP.NET pages to read/write data from an access database
I have everything working with the exception of updating memo fields
Description is a memo field in my access database
<asp:ControlParameter ControlID="tbDescription" DbType="String" Name="Description" PropertyName="Text" />
my update statement executes without an error and all fields are updated in the database except the memo fields
UpdateCommand="UPDATE Bills SET LegYear = @LegYear, Author = @Author, Topic = @Topic, Center = @Center, Branch_Assignment = @Branch, Assigned_Staff = @Staff, [Position] = [@Position], Version_Date = @Version_Date, Received_Date = @Received_Date, Assigned_Date = @Assigned_Date, Completed_Date = @Completed_Date, Chapter_Number = @ChapterNumber, Bill_Assignment = @BillAssignment, Due_Date = @Due_Date, [Description] = [@Description], Comments = @Comments, Hyperlink = @Hyperlink, Bill_Status = @BillStatus WHERE (ID = @BillId)">
Is DbType of String the correct type for Memo fields?
thanks
mike
Wednesday, June 15, 2011 5:07 PM
Answers
-
User-442518976 posted
ugh! it was the parameter order
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, June 18, 2011 1:54 AM
All replies
-
User-1199946673 posted
Is DbType of String the correct type for Memo fields?
Yes it is. You don't even have tho specify the DbType property to get it working with Access. Everything seems to look fine, the only thing I can think of is that the order of your Parameters doesn't match the order in which they appear in the command. Can you show us the complete AccessDatasource?
Thursday, June 16, 2011 3:14 AM -
User3866881 posted
Hello mhowes:)
Just some additions——1)Please make sure that your "tbDescription" is a TextBox or something else that has a public property called "Text", whose type is of string.
2)Please be sure that your "tbDescription" is a control that locates the same place where the SqlDataSource or ObjectDataSource locates (I mean you cannot nest the "tbDescription" inside a GridView or DataList or some data presentation controls, you cannot find it using this way).
3)If your value to be inserted is really type of varchar(max) or something related with char, the DbTye can be ignored, because it will automatcially be converted to type of string.
Thx
Thursday, June 16, 2011 9:25 PM -
User-442518976 posted
ugh! it was the parameter order
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, June 18, 2011 1:54 AM