title: vb.net Property access must assign to the property or use its value in windows forms
body: <p>i am working in vb.net windows application</p>
  
  <p>in my load event i am giving code like this for loading data from different table to my datagridview.</p>
  
  <p>for that i given code like this:</p>
  
  <pre><code>Dim da As New SqlDataAdapter
  Dim cmd As New SqlCommand("select M.Model,c.Colname,ma.Make from Model_tbl M join Color_tbl C on c.colid=M.mdlid join Make_tbl ma on ma.mkid=c.colid  where mdlid=5", con.connect)
          Dim builder As SqlClient.SqlCommandBuilder = New SqlCommandBuilder(da)
  
          da.SelectCommand = cmd
          da.Fill(ds, "MyTable")
          If (ds.Tables(0).Rows.Count &gt; 0) Then
              DGV.DataSource = ds.Tables("MyTable")
  
          End If
  </code></pre>
  
  <p>When clicking update button I want to update data to different tables from my datagridview.. so I wrote code like this in my update button event..</p>
  
  <pre><code> Me.Validate()
              da.UpdateCommand(ds.Tables("MyTable"))
              Me.ds.AcceptChanges()
  </code></pre>
  
  <p>but i am getting error in this line:</p>
  
  <pre><code>da.UpdateCommand(ds.Tables("MyTable"))
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Property access must assign to the property or use its value.</p>
  </blockquote>