Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your example isn't consistent since you have DataObjectTypeName set, but your LeasesDS_Inserting method is adding parameters as if it's not.</p> <p>If you don't need DataObjectTypeName, you can remove it and then you should have a better chance getting this to work.</p> <p>If you need DataObjectTypeName or just prefer it (as I do), there is a way to get this to work, but it's not pretty.</p> <p>In your LeasesGrid_RowCommand method, you can use code like this to get the view:</p> <pre><code>IDataSource ds = (IDataSource)LeasesDS; DataSourceView view = ds.GetView(LeasesGrid.DataMember); </code></pre> <p>After getting the view, you can build a dictionary containing the values that need to get written to the data object that will eventually get passed in to your Insert method. The code for that will look very similar to what you have in LeasesDS_Inserting, but you'll be inserting into your own dictionary instead of e.InputParameters.</p> <p>Once you have your dictionary ready, you can invoke Insert on the view with something like this:</p> <pre><code>view.Insert(dict, delegate { return false; }); </code></pre> <p>That should do it.</p> <p>You won't need the LeasesDS_Inserting method any more since the view's Insert method will do the work of converting the dictionary you gave it into the data object that it's going to pass in to your Insert method.</p> <p>If you need to do more processing of the properties on that data object, you will see it in the InputParameters dictionary passed in to LeasesDS_Inserting.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload