Wrox Home  
Search P2P Archive for: Go

  Return to Index  

dotnet_windows_app_design thread: Updating a row in a DataSet


Message #1 by "Keith R. Pinster" <keith.pinster@a...> on Fri, 3 Jan 2003 17:25:47
How do I update a row in a DataSet.  .NET keeps telling me that the Item 
is read-only.  The field is a type Boolean.  I've tried a couple of 
different code lines:

------------------------------------------------------------------
g_DSQuestions.Tables(0).Rows(m_intQuestion).BeginEdit()
g_DSQuestions.Tables(0).Rows(m_intQuestion)(3) = True
------------------------------------------------------------------

------------------------------------------------------------------
g_DSQuestions.Tables(0).Rows(m_intQuestion).BeginEdit()
g_DSQuestions.Tables(0).Rows(m_intQuestion).Items("Answered") = True
------------------------------------------------------------------

------------------------------------------------------------------
arrQuestionData(0) = g_DSQuestions.Tables(0).Rows(m_intQuestion).Item
("QuestionID")
arrQuestionData(1) = g_DSQuestions.Tables(0).Rows(m_intQuestion).Item
("QuestionOrdinal")
arrQuestionData(2) = g_DSQuestions.Tables(0).Rows(m_intQuestion).Item
("QuestionText")
arrQuestionData(3) = True
g_DSQuestions.Tables(0).Rows(m_intQuestion).BeginEdit()
g_DSQuestions.Tables(0).Rows(m_intQuestion) = arrQuestionData
------------------------------------------------------------------

All of these end up with the system throwing an error that the Item column 
is read-only.  How do I un-protect the stupid row?!?

Thanks for your help in advance.

  Return to Index