Add / Insert a row in xsd dataset or Typed dataset


// Create a new row.
NorthwindDataSet.RegionRow newRegionRow;
newRegionRow = northwindDataSet.Region.NewRegionRow();
newRegionRow.RegionID = 5;
newRegionRow.RegionDescription = "NorthWestern";

// Add the row to the Region table
this.northwindDataSet.Region.Rows.Add(newRegionRow);

// Save the new row to the database
this.regionTableAdapter.Update(this.northwindDataSet.Region)

======================================================================================================================================
other way : (better way :) )

tableAdapter.Insert(.........);
Advertisements

2 thoughts on “Add / Insert a row in xsd dataset or Typed dataset

  1. I have been exploring for a little for any high quality articles or weblog posts in this kind
    of house . Exploring in Yahoo I at last stumbled upon this
    site. Studying this information So i’m happy to convey that I’ve a
    very excellent uncanny feeling I discovered exactly what I needed.

    I such a lot without a doubt will make certain to do not disregard this website and provides it a look on
    a constant basis.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s