Link to home
Start Free TrialLog in
Avatar of rwheeler23
rwheeler23Flag for United States of America

asked on

VS C# and only committing records that have a value in a certain column

Using VS C# I populate a dataset and then using a data grid view I display a grid on the screen. There 8 columns and 12 rows displayed at once. The first column is the most significant. In this case it is a job number.  Right now when this code is executed all records are committed to the database. My question is this. Is there a way to only write the records that have a job number? In other words is there a way to filter the committed records to only be the records that have a value for job number? Should I not be using command builder? I could provide additional code if that would be helpful.
            try
            {
                _commandBuilder.GetUpdateCommand();

                DistDataAdapter.Update(DistDataSet);
            }
            catch (Exception ex)
            {
                string eMsg = "View-JL-004: ERROR: " + ex.Message;
                if (Model.stackTraceWanted) eMsg += "\n" + ex.StackTrace;
                MessageBox.Show(eMsg);
            }
ASKER CERTIFIED SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rwheeler23

ASKER

Thank you. I did not know about this.