Silverlight / WPF - Call and run insert command Visual studio 2008

Asked By David on 08-Jul-11 05:21 AM
Earn up to 10 extra points for answering this tough question.
Hi All
 I have been trying for a year to solve the problem of running an Insert command from a Dataset to put a new row into Table 2 from table 1 The Insert run in design mode is perfect but I have no clue how to call and run in my prog
I am using a Datagridview to see all options available and want to just click on a row and then run the code.

The code I tried below is one of my many attemps.

Private
Sub BindingNavigatorAddNewItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click

'Dim CourseS_PLAYEDTableAdapter As New CoursesPlayedDataSet

'Dim TableAdapter As New TableRow

'Dim connString As String = ConfigurationManager.ConnectionStrings("WpfDataEntry.MySettings.VB_DAVE_1__mainConnectionString").ConnectionString

'Dim SqlConnection = New SqlConnection

'Dim SqlCommand As New SqlCommand

'Me.Prikey3DataGridViewTextBoxColumn.DataGridView.Select()



'COURSESPLAYEDBindingSource.EndEdit()

Me.taManager.UpdateAll(Me.CoursesPlayedDataSet)

CoursesPlayedDataSet.AcceptChanges()

Dim newWindow12 = New Window12

Me.Close()

Dim newWindow3 = New Window3

newWindow3.Show()

End Sub

Thanks David

Web Star replied to David on 12-Jul-11 12:53 AM
WPF provides a simple and powerful way to auto-update data between the business model and the user interface.

Databinding can be unidirectional (source -> target or target <- source), or bidirectional (source <-> target).


you can insert data in wpf form using TwoWay Changes to source and destination are copied to each other .
For more details see these link
http://www.codeproject.com/KB/WPF/WpfDataBinding1.aspx
http://www.wpftutorial.net/DataBindingOverview.html