Hi all,

I have the following scenario here:

When clicking to the Save button of the bindingnavigator the data is not saved in the database. I can see the number of rows is incremented by If i close the application and run it again the row just add is not there. Take a look to the table datatable and there is not record either.

All the interactions between the db and the application is thru the DataSet Wizard.

Please really need help on this issue.

I have read the forum and see that might be different causes for it.

1. Location of the database. My database is located in the Visual Studio 2008/Projects Folder. And the Copy to Output Directory setting is : "Do not copy". I believe that if the db is in this path then need to set "Copy Always"?

2. SELECT, DELETE, INSERT, UPDATE statements has been created in the tableadapter.

What can I do to make the Save Button work?. it stresses me out.


If it is necessary I can send the project in order to have a better description on the issue that I am experiecing now. Just let me know.

Thanks very much and I will look forward to the replies.


Regards,
Jorge


1 Public Class frmMasterVendorFile
2
3 Private Sub TblVendorBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
4 Me.Validate()
5 Me.TblVendorBindingSource.EndEdit()
6 Me.TableAdapterManager.UpdateAll(Me.VendorMasterFileDataSet)
7
8 End Sub
9
10 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
11
12 Me.TblContractTableAdapter.Fill(Me.VendorMasterFileDataSet.tblContract)
13
14 Me.TblTermTableAdapter.Fill(Me.VendorMasterFileDataSet.tblTerm)
15
16 Me.TblVendorTableAdapter.Fill(Me.VendorMasterFileDataSet.tblVendor)
17
18 'Me.TblVendorTableAdapter.Fill(Me.VendorMasterFileDataSet.tblVendor)
19
20 ' TblVendorBindingNavigator.AddNewItem.Enabled = False
21 ' TblVendorBindingNavigatorSaveItem.Enabled = False
22 Label2.Text = System.DateTime.Now
23 FillByVendorIDToolStrip1.Enabled = False
24 cmdReset.Enabled = False
25

31 End Sub

35 Private Sub TblVendorDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles TblVendorDataGridView.CellContentClick
36
37 End Sub
38
39 Private Sub VendorFaxTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VendorFaxTextBox.TextChanged
40
41 End Sub
42
43 Private Sub VendorFaxLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
44
45 End Sub
46
47 Private Sub VendorZipCodeTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VendorZipCodeTextBox.TextChanged
48
49 End Sub
50
51 Private Sub BillingPhoneTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BillingPhoneTextBox.TextChanged
52
53 End Sub
54
55 Private Sub TermIDLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
56
57 End Sub
58
59 Private Sub VendorNameTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VendorNameTextBox.TextChanged
60
61 End Sub
62
63 Private Sub VendorNameLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
64
65 End Sub
66
67 Private Sub _1099BCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _1099BCheckBox.CheckedChanged
68
69 End Sub
70
71 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
72 Me.Close()
73
74 End Sub
75
76 Private Sub Attention2TextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Attention2TextBox.TextChanged
77
78 End Sub
79
80 Private Sub Attention2Label_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
81
82 End Sub
83
84 Private Sub BindingNavigatorMoveNextItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorMoveNextItem.Click
85
86 End Sub
87
88 Private Sub DateOfEntryLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
89
90 End Sub
91
92 Private Sub DateOfEntryLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
93
94
95 End Sub
96
97 Private Sub TblVendorBindingNavigator_RefreshItems(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TblVendorBindingNavigator.RefreshItems
98
99 End Sub
100
101 Private Sub MailingCityTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MailingCityTextBox.TextChanged
102
103 End Sub
104
105 Private Sub MailingCityLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
106
107 End Sub
108
109 Private Sub ContractIDComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ContractIDComboBox.SelectedIndexChanged
110
111 End Sub
112
113 Private Sub ContractIDLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
114
115 End Sub
116
117 Private Sub cmdDisplayVendor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDisplayVendor.Click
118
119 'TblVendorBindingNavigator.AddNewItem.Visible = False
120 'TblVendorBindingNavigator.DeleteItem.Visible = False
121 'TblVendorBindingNavigatorSaveItem.Visible = False
122
123
124 'Me.TblContractTableAdapter.Fill(Me.VendorMasterFileDataSet.tblContract)
125
126 'Me.TblTermTableAdapter.Fill(Me.VendorMasterFileDataSet.tblTerm)
127
128 'Me.TblVendorTableAdapter.Fill(Me.VendorMasterFileDataSet.tblVendor)
129
130 'Me.TblVendorTableAdapter.Fill(Me.VendorMasterFileDataSet.tblVendor)
131 Me._1099BCheckBox.Checked = False
132 Me._1099FCheckBox.Checked = False
133 Me._1099TCheckBox.Checked = False
134
135 FillByVendorIDToolStrip1.Enabled = True
136 cmdDisplayVendor.Enabled = True
137 cmdReset.Enabled = True
138 Label3.Text = "List of Vendors (Display Only)"
139 Label3.Font = New Font("Tahoma", 12, FontStyle.Bold)
140
141
142
143
144
145 End Sub
146
147 Private Sub FillByVendorIDToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FillByVendorIDToolStripButton1.Click
148
149 Try
150
151 Me.TblVendorTableAdapter.FillByVendorID(Me.VendorMasterFileDataSet.tblVendor, VendoridToolStripTextBox1.Text)
152 Catch ex As System.Exception
153 System.Windows.Forms.MessageBox.Show(ex.Message)
154 End Try
155
156
157
158 End Sub
159
160 Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReset.Click
161 'Me.TblContractTableAdapter.Fill(Me.VendorMasterFileDataSet.tblContract)
162
163 'Me.TblTermTableAdapter.Fill(Me.VendorMasterFileDataSet.tblTerm)
164
165 'Me.TblVendorTableAdapter.Fill(Me.VendorMasterFileDataSet.tblVendor)
166
167 'Me.TblVendorTableAdapter.Fill(Me.VendorMasterFileDataSet.tblVendor)
168 End Sub
169
170 Private Sub cmdManageVendor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdManageVendor.Click
171 'Me.TblContractTableAdapter.Fill(Me.VendorMasterFileDataSet.tblContract)
172
173 'Me.TblTermTableAdapter.Fill(Me.VendorMasterFileDataSet.tblTerm)
174
175 'Me.TblVendorTableAdapter.Fill(Me.VendorMasterFileDataSet.tblVendor)
176
177 'Me.TblVendorTableAdapter.Fill(Me.VendorMasterFileDataSet.tblVendor)
178
179 'TblVendorBindingNavigatorSaveItem.Enabled = True
180 FillByVendorIDToolStrip1.Enabled = True
181 cmdReset.Enabled = True
182
183 'TblVendorBindingNavigator.AddNewItem.Visible = True
184 'TblVendorBindingNavigator.DeleteItem.Visible = True
185 'TblVendorBindingNavigatorSaveItem.Visible = True
186
187 Label3.Text = "List of Vendors (Management Profile)"
188 Label3.Font = New Font("Tahoma", 12, FontStyle.Bold)
189

200 End Sub
201
202 End Class
203
[