How to use the spread to edit the content of a database

Posted by: torben-laursen on 8 September 2017, 12:30 pm EST

  • Posted 8 September 2017, 12:30 pm EST

    I want to use a spread to let the user edit the content of a table in a database.

    I can connect to the database and show the table in the spread but I have not been able to send any change back to the database.

    Can anyone show me a few lines of C# code that performs this task?

    I have tryed code like this:

    DataSet dataset = (DataSet)FSP_P_View.DataSource;     
                <SPAN class=kwd>if</SPAN> (dataset.HasChanges(DataRowState.Modified))
                    MessageBox.Show(<SPAN class=st>"Database updated "</SPAN>);
                    <SPAN class=kwd>return</SPAN>;
                MessageBox.Show(<SPAN class=st>"No change found"</SPAN>);

     But HasChanges allways returns false no matter how much I change in the spread

    Thanks Torben

  • Replied 8 September 2017, 12:30 pm EST

    Torben -

    The best thing to do is run the SpreadWinDemo that ships with the product.  It has a data binding form in it with a button that has code in it that shows how to update the database.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels