cdsDataDataSet.XRefRow dr = xref.NewXRefRow();
dr.display = "Hi There";
xref.Rows.Add(dr);
xref.AcceptChanges();
The code is very ugly, and var names are garbage cause I'm just playing around trying to see how things work. But hopefully I have what you need to see here:// ********** jobTree.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace cdsJobs { public partial class jobTree : WeifenLuo.WinFormsUI.Docking.DockContent { cdsDataDataSet dsXRef; cdsDataDataSet.XRefDataTable xref; cdsDataDataSetTableAdapters.XRefTableAdapter dsTA; public jobTree() { InitializeComponent(); dsXRef = new cdsDataDataSet(); dsTA = new cdsDataDataSetTableAdapters.XRefTableAdapter(); xref = dsTA.GetData(); cdsNode tn = new cdsNode(); tn.Text = xref[0].display; tn.rec = 0; treeView.Nodes.Add(tn); } private void OnTreeContextMenuSelect(object sender, EventArgs e) { cdsDataDataSet.XRefRow dr = xref.NewXRefRow(); dr.display = "Hi There"; xref.Rows.Add(dr); Int32 id = xref[0].id; cdsNode tn = new cdsNode(); tn.Text = "Test" + id.ToString("00000000"); tn.rec = xref.Rows.Count - 1; treeView.SelectedNode.Nodes.Add(tn); treeView.SelectedNode = tn; xref.AcceptChanges(); } } public class cdsNode : TreeNode { public int rec = 0; } } // ********** Auto generated from dataset.cs this._adapter.InsertCommand = new System.Data.SqlClient.SqlCommand(); this._adapter.InsertCommand.Connection = this.Connection; this._adapter.InsertCommand.CommandText = "INSERT INTO [XRef] ([root], [parent], [DisplayOrder], [xref], [type], [alias], [d" + "isplay], [value], [freq], [lastused]) VALUES (@root, @parent, @DisplayOrder, @xr" + "ef, @type, @alias, @display, @value, @freq, @lastused)"; this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;