| Home | Forums | Reviews | Articles | Register |
![]() |
| Thread Tools | Rate Thread |
|
|
|
| |
|
=?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=
Guest
Posts: n/a
|
i can get it to update if i set Me.daMem.ContinueUpdateOnError = True
this being said how can i see the error? again please ANY advice on this would be appreciated -- thanks (as always) some day i''m gona pay this forum back for all the help i''m getting kes "WebBuilder451" wrote: > I've run into an interesting problem: > I have a very straight forward form that will update or insert records using > a dataadapter and a dataset. I worked fine until i changed the select > parameter. > i regenerated the dataset and configured the adapter. Now i can't update nor > insert > I can select fine, but when i insert or update the table does not get > updated. There are no errors just nothing. when i check for dataset changes i > get a true. > ok here is the code (is there a bug or known issues with vs.net or changing > sp's that will cause this?) > Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles lbtnUpdate.Click > Try > ' get the current data set with the row > Me.daMem.SelectCommand.Parameters(1).Value = User.Identity.Name > Me.daMem.Fill(Me.DsMem1.usr) > ' set the values in the row and update > With Me.DsMem1.usr(0) > .usrFName = Me.txtFName.Text > .usrMI = Me.txtMi.Text > .usrLName = Me.txtLname.Text > .usrTitle = Me.txtTitle.Text > .usrEmail = Me.txtEmail.Text > .usrUrl = Me.txtURL.Text > .usrUserID = Me.txtUserID.Text > .usrPassword = Me.txtPswd.Text > .usrPhone = Me.txtPhone.Text > .usrWkPhone = Me.txtWkPhone.Text > .usrCellPhone = Me.txtCell.Text > .usrFax = Me.txtFax.Text > .usrCompany = Me.txtCompany.Text > .usrAddress = Me.txtAddress.Text > .usrCity = Me.txtCity.Text > .usrState = Me.ddlState.SelectedValue > .usrZip = Me.txtZip.Text > .usrMemType = Me.txtMemType.Text > .usrMemDate = Me.txtMemDate.Text > .usrExpDate = Me.txtMemExpDate.Text > .usrExtra1 = Me.txtExtra1.Text > .usrExtra2 = Me.txtExtra2.Text > .usrStatus = Me.chkStatus.Checked > End With > Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString > Me.lblMSG.Text &= Me.DsMem1.HasErrors() > Me.daMem.Update(Me.DsMem1) > ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + > Me.DsMem1.usr(0).usrID.ToString > Catch ex As Exception > Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> <B>STACK > TRACE:</B> {1}", _ > ex.Message, ex.StackTrace) > Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + "<br>" > + msg > End Try > End Sub > -- > thanks (as always) > some day i''m gona pay this forum back for all the help i''m getting > kes |
|
||
|
||||
|
Sahil Malik [MVP]
Guest
Posts: n/a
|
What value does the HasErrors property on the DataTable have after you run
DataAdapter.Update? You can get the error per row as the RowError property, if you databind it to a datagrid it will appear as an exclamation mark and a relevant tooltip. The exact reason for the error - more than likely your InsertCommand and UpdateCommand are faulty. Check the CommandText for those two, using either debug mode, or SQL Profiler. - Sahil Malik [MVP] ADO.NET 2.0 book - http://codebetter.com/blogs/sahil.ma.../13/63199.aspx ---------------------------------------------------------------------------- "WebBuilder451" <(E-Mail Removed)> wrote in message news:15CC24EE-05B6-4DB1-90A4-(E-Mail Removed)... >i can get it to update if i set Me.daMem.ContinueUpdateOnError = True > this being said how can i see the error? > again please ANY advice on this would be appreciated > -- > thanks (as always) > some day i''m gona pay this forum back for all the help i''m getting > kes > > > "WebBuilder451" wrote: > >> I've run into an interesting problem: >> I have a very straight forward form that will update or insert records >> using >> a dataadapter and a dataset. I worked fine until i changed the select >> parameter. >> i regenerated the dataset and configured the adapter. Now i can't update >> nor >> insert >> I can select fine, but when i insert or update the table does not get >> updated. There are no errors just nothing. when i check for dataset >> changes i >> get a true. >> ok here is the code (is there a bug or known issues with vs.net or >> changing >> sp's that will cause this?) >> Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal e >> As >> System.EventArgs) Handles lbtnUpdate.Click >> Try >> ' get the current data set with the row >> Me.daMem.SelectCommand.Parameters(1).Value = >> User.Identity.Name >> Me.daMem.Fill(Me.DsMem1.usr) >> ' set the values in the row and update >> With Me.DsMem1.usr(0) >> .usrFName = Me.txtFName.Text >> .usrMI = Me.txtMi.Text >> .usrLName = Me.txtLname.Text >> .usrTitle = Me.txtTitle.Text >> .usrEmail = Me.txtEmail.Text >> .usrUrl = Me.txtURL.Text >> .usrUserID = Me.txtUserID.Text >> .usrPassword = Me.txtPswd.Text >> .usrPhone = Me.txtPhone.Text >> .usrWkPhone = Me.txtWkPhone.Text >> .usrCellPhone = Me.txtCell.Text >> .usrFax = Me.txtFax.Text >> .usrCompany = Me.txtCompany.Text >> .usrAddress = Me.txtAddress.Text >> .usrCity = Me.txtCity.Text >> .usrState = Me.ddlState.SelectedValue >> .usrZip = Me.txtZip.Text >> .usrMemType = Me.txtMemType.Text >> .usrMemDate = Me.txtMemDate.Text >> .usrExpDate = Me.txtMemExpDate.Text >> .usrExtra1 = Me.txtExtra1.Text >> .usrExtra2 = Me.txtExtra2.Text >> .usrStatus = Me.chkStatus.Checked >> End With >> Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString >> Me.lblMSG.Text &= Me.DsMem1.HasErrors() >> Me.daMem.Update(Me.DsMem1) >> ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + >> Me.DsMem1.usr(0).usrID.ToString >> Catch ex As Exception >> Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> >> <B>STACK >> TRACE:</B> {1}", _ >> ex.Message, ex.StackTrace) >> Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + >> "<br>" >> + msg >> End Try >> End Sub >> -- >> thanks (as always) >> some day i''m gona pay this forum back for all the help i''m getting >> kes |
|
||
|
||||
|
=?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=
Guest
Posts: n/a
|
the haserrors on the usr table is comming back false
-- thanks (as always) some day i''m gona pay this forum back for all the help i''m getting kes "Sahil Malik [MVP]" wrote: > What value does the HasErrors property on the DataTable have after you run > DataAdapter.Update? > You can get the error per row as the RowError property, if you databind it > to a datagrid it will appear as an exclamation mark and a relevant tooltip. > > The exact reason for the error - more than likely your InsertCommand and > UpdateCommand are faulty. Check the CommandText for those two, using either > debug mode, or SQL Profiler. > > - Sahil Malik [MVP] > ADO.NET 2.0 book - > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > ---------------------------------------------------------------------------- > > > "WebBuilder451" <(E-Mail Removed)> wrote in message > news:15CC24EE-05B6-4DB1-90A4-(E-Mail Removed)... > >i can get it to update if i set Me.daMem.ContinueUpdateOnError = True > > this being said how can i see the error? > > again please ANY advice on this would be appreciated > > -- > > thanks (as always) > > some day i''m gona pay this forum back for all the help i''m getting > > kes > > > > > > "WebBuilder451" wrote: > > > >> I've run into an interesting problem: > >> I have a very straight forward form that will update or insert records > >> using > >> a dataadapter and a dataset. I worked fine until i changed the select > >> parameter. > >> i regenerated the dataset and configured the adapter. Now i can't update > >> nor > >> insert > >> I can select fine, but when i insert or update the table does not get > >> updated. There are no errors just nothing. when i check for dataset > >> changes i > >> get a true. > >> ok here is the code (is there a bug or known issues with vs.net or > >> changing > >> sp's that will cause this?) > >> Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal e > >> As > >> System.EventArgs) Handles lbtnUpdate.Click > >> Try > >> ' get the current data set with the row > >> Me.daMem.SelectCommand.Parameters(1).Value = > >> User.Identity.Name > >> Me.daMem.Fill(Me.DsMem1.usr) > >> ' set the values in the row and update > >> With Me.DsMem1.usr(0) > >> .usrFName = Me.txtFName.Text > >> .usrMI = Me.txtMi.Text > >> .usrLName = Me.txtLname.Text > >> .usrTitle = Me.txtTitle.Text > >> .usrEmail = Me.txtEmail.Text > >> .usrUrl = Me.txtURL.Text > >> .usrUserID = Me.txtUserID.Text > >> .usrPassword = Me.txtPswd.Text > >> .usrPhone = Me.txtPhone.Text > >> .usrWkPhone = Me.txtWkPhone.Text > >> .usrCellPhone = Me.txtCell.Text > >> .usrFax = Me.txtFax.Text > >> .usrCompany = Me.txtCompany.Text > >> .usrAddress = Me.txtAddress.Text > >> .usrCity = Me.txtCity.Text > >> .usrState = Me.ddlState.SelectedValue > >> .usrZip = Me.txtZip.Text > >> .usrMemType = Me.txtMemType.Text > >> .usrMemDate = Me.txtMemDate.Text > >> .usrExpDate = Me.txtMemExpDate.Text > >> .usrExtra1 = Me.txtExtra1.Text > >> .usrExtra2 = Me.txtExtra2.Text > >> .usrStatus = Me.chkStatus.Checked > >> End With > >> Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString > >> Me.lblMSG.Text &= Me.DsMem1.HasErrors() > >> Me.daMem.Update(Me.DsMem1) > >> ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + > >> Me.DsMem1.usr(0).usrID.ToString > >> Catch ex As Exception > >> Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> > >> <B>STACK > >> TRACE:</B> {1}", _ > >> ex.Message, ex.StackTrace) > >> Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + > >> "<br>" > >> + msg > >> End Try > >> End Sub > >> -- > >> thanks (as always) > >> some day i''m gona pay this forum back for all the help i''m getting > >> kes > > > |
|
||
|
||||
|
Sahil Malik [MVP]
Guest
Posts: n/a
|
Okay what about the rest of the things I asked?
-- - Sahil Malik [MVP] ADO.NET 2.0 book - http://codebetter.com/blogs/sahil.ma.../13/63199.aspx ---------------------------------------------------------------------------- --------------- "WebBuilder451" <(E-Mail Removed)> wrote in message news:EEB68FB4-1716-40FA-B172-(E-Mail Removed)... > the haserrors on the usr table is comming back false > -- > thanks (as always) > some day i''m gona pay this forum back for all the help i''m getting > kes > > > "Sahil Malik [MVP]" wrote: > > > What value does the HasErrors property on the DataTable have after you run > > DataAdapter.Update? > > You can get the error per row as the RowError property, if you databind it > > to a datagrid it will appear as an exclamation mark and a relevant tooltip. > > > > The exact reason for the error - more than likely your InsertCommand and > > UpdateCommand are faulty. Check the CommandText for those two, using either > > debug mode, or SQL Profiler. > > > > - Sahil Malik [MVP] > > ADO.NET 2.0 book - > > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > > -------------------------------------------------------------------------- -- > > > > > > "WebBuilder451" <(E-Mail Removed)> wrote in message > > news:15CC24EE-05B6-4DB1-90A4-(E-Mail Removed)... > > >i can get it to update if i set Me.daMem.ContinueUpdateOnError = True > > > this being said how can i see the error? > > > again please ANY advice on this would be appreciated > > > -- > > > thanks (as always) > > > some day i''m gona pay this forum back for all the help i''m getting > > > kes > > > > > > > > > "WebBuilder451" wrote: > > > > > >> I've run into an interesting problem: > > >> I have a very straight forward form that will update or insert records > > >> using > > >> a dataadapter and a dataset. I worked fine until i changed the select > > >> parameter. > > >> i regenerated the dataset and configured the adapter. Now i can't update > > >> nor > > >> insert > > >> I can select fine, but when i insert or update the table does not get > > >> updated. There are no errors just nothing. when i check for dataset > > >> changes i > > >> get a true. > > >> ok here is the code (is there a bug or known issues with vs.net or > > >> changing > > >> sp's that will cause this?) > > >> Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal e > > >> As > > >> System.EventArgs) Handles lbtnUpdate.Click > > >> Try > > >> ' get the current data set with the row > > >> Me.daMem.SelectCommand.Parameters(1).Value = > > >> User.Identity.Name > > >> Me.daMem.Fill(Me.DsMem1.usr) > > >> ' set the values in the row and update > > >> With Me.DsMem1.usr(0) > > >> .usrFName = Me.txtFName.Text > > >> .usrMI = Me.txtMi.Text > > >> .usrLName = Me.txtLname.Text > > >> .usrTitle = Me.txtTitle.Text > > >> .usrEmail = Me.txtEmail.Text > > >> .usrUrl = Me.txtURL.Text > > >> .usrUserID = Me.txtUserID.Text > > >> .usrPassword = Me.txtPswd.Text > > >> .usrPhone = Me.txtPhone.Text > > >> .usrWkPhone = Me.txtWkPhone.Text > > >> .usrCellPhone = Me.txtCell.Text > > >> .usrFax = Me.txtFax.Text > > >> .usrCompany = Me.txtCompany.Text > > >> .usrAddress = Me.txtAddress.Text > > >> .usrCity = Me.txtCity.Text > > >> .usrState = Me.ddlState.SelectedValue > > >> .usrZip = Me.txtZip.Text > > >> .usrMemType = Me.txtMemType.Text > > >> .usrMemDate = Me.txtMemDate.Text > > >> .usrExpDate = Me.txtMemExpDate.Text > > >> .usrExtra1 = Me.txtExtra1.Text > > >> .usrExtra2 = Me.txtExtra2.Text > > >> .usrStatus = Me.chkStatus.Checked > > >> End With > > >> Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString > > >> Me.lblMSG.Text &= Me.DsMem1.HasErrors() > > >> Me.daMem.Update(Me.DsMem1) > > >> ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + > > >> Me.DsMem1.usr(0).usrID.ToString > > >> Catch ex As Exception > > >> Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> > > >> <B>STACK > > >> TRACE:</B> {1}", _ > > >> ex.Message, ex.StackTrace) > > >> Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + > > >> "<br>" > > >> + msg > > >> End Try > > >> End Sub > > >> -- > > >> thanks (as always) > > >> some day i''m gona pay this forum back for all the help i''m getting > > >> kes > > > > > > |
|
||
|
||||
|
=?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=
Guest
Posts: n/a
|
row is false also.
But now it is working and the continue on error is false. (?) I did a check yesterday to see if the sp was getting called by harcoding a paramter value and it showed that the sp was not getting called. It was as if it were getting skipped. This has happened to me a few time and my guess is that as you suggested it's an error in the table. I'd think a sql error would give an exception. I would think that an error in the ds.table.row would also throw an exception is this true or does it need to be checked? thanks for your help kes -- thanks (as always) some day i''m gona pay this forum back for all the help i''m getting kes "Sahil Malik [MVP]" wrote: > Okay what about the rest of the things I asked? > > -- > > - Sahil Malik [MVP] > ADO.NET 2.0 book - > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > ---------------------------------------------------------------------------- > --------------- > > "WebBuilder451" <(E-Mail Removed)> wrote in message > news:EEB68FB4-1716-40FA-B172-(E-Mail Removed)... > > the haserrors on the usr table is comming back false > > -- > > thanks (as always) > > some day i''m gona pay this forum back for all the help i''m getting > > kes > > > > > > "Sahil Malik [MVP]" wrote: > > > > > What value does the HasErrors property on the DataTable have after you > run > > > DataAdapter.Update? > > > You can get the error per row as the RowError property, if you databind > it > > > to a datagrid it will appear as an exclamation mark and a relevant > tooltip. > > > > > > The exact reason for the error - more than likely your InsertCommand and > > > UpdateCommand are faulty. Check the CommandText for those two, using > either > > > debug mode, or SQL Profiler. > > > > > > - Sahil Malik [MVP] > > > ADO.NET 2.0 book - > > > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > > > > -------------------------------------------------------------------------- > -- > > > > > > > > > "WebBuilder451" <(E-Mail Removed)> wrote in > message > > > news:15CC24EE-05B6-4DB1-90A4-(E-Mail Removed)... > > > >i can get it to update if i set Me.daMem.ContinueUpdateOnError = True > > > > this being said how can i see the error? > > > > again please ANY advice on this would be appreciated > > > > -- > > > > thanks (as always) > > > > some day i''m gona pay this forum back for all the help i''m getting > > > > kes > > > > > > > > > > > > "WebBuilder451" wrote: > > > > > > > >> I've run into an interesting problem: > > > >> I have a very straight forward form that will update or insert > records > > > >> using > > > >> a dataadapter and a dataset. I worked fine until i changed the select > > > >> parameter. > > > >> i regenerated the dataset and configured the adapter. Now i can't > update > > > >> nor > > > >> insert > > > >> I can select fine, but when i insert or update the table does not get > > > >> updated. There are no errors just nothing. when i check for dataset > > > >> changes i > > > >> get a true. > > > >> ok here is the code (is there a bug or known issues with vs.net or > > > >> changing > > > >> sp's that will cause this?) > > > >> Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal > e > > > >> As > > > >> System.EventArgs) Handles lbtnUpdate.Click > > > >> Try > > > >> ' get the current data set with the row > > > >> Me.daMem.SelectCommand.Parameters(1).Value = > > > >> User.Identity.Name > > > >> Me.daMem.Fill(Me.DsMem1.usr) > > > >> ' set the values in the row and update > > > >> With Me.DsMem1.usr(0) > > > >> .usrFName = Me.txtFName.Text > > > >> .usrMI = Me.txtMi.Text > > > >> .usrLName = Me.txtLname.Text > > > >> .usrTitle = Me.txtTitle.Text > > > >> .usrEmail = Me.txtEmail.Text > > > >> .usrUrl = Me.txtURL.Text > > > >> .usrUserID = Me.txtUserID.Text > > > >> .usrPassword = Me.txtPswd.Text > > > >> .usrPhone = Me.txtPhone.Text > > > >> .usrWkPhone = Me.txtWkPhone.Text > > > >> .usrCellPhone = Me.txtCell.Text > > > >> .usrFax = Me.txtFax.Text > > > >> .usrCompany = Me.txtCompany.Text > > > >> .usrAddress = Me.txtAddress.Text > > > >> .usrCity = Me.txtCity.Text > > > >> .usrState = Me.ddlState.SelectedValue > > > >> .usrZip = Me.txtZip.Text > > > >> .usrMemType = Me.txtMemType.Text > > > >> .usrMemDate = Me.txtMemDate.Text > > > >> .usrExpDate = Me.txtMemExpDate.Text > > > >> .usrExtra1 = Me.txtExtra1.Text > > > >> .usrExtra2 = Me.txtExtra2.Text > > > >> .usrStatus = Me.chkStatus.Checked > > > >> End With > > > >> Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString > > > >> Me.lblMSG.Text &= Me.DsMem1.HasErrors() > > > >> Me.daMem.Update(Me.DsMem1) > > > >> ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + > > > >> Me.DsMem1.usr(0).usrID.ToString > > > >> Catch ex As Exception > > > >> Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> > > > >> <B>STACK > > > >> TRACE:</B> {1}", _ > > > >> ex.Message, ex.StackTrace) > > > >> Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + > > > >> "<br>" > > > >> + msg > > > >> End Try > > > >> End Sub > > > >> -- > > > >> thanks (as always) > > > >> some day i''m gona pay this forum back for all the help i''m getting > > > >> kes > > > > > > > > > > > > |
|
||
|
||||
|
=?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=
Guest
Posts: n/a
|
..... columnsinerror is length 0.
shouldn't the row be in error if a column is in error? thanks kes -- thanks (as always) some day i''m gona pay this forum back for all the help i''m getting kes "Sahil Malik [MVP]" wrote: > Okay what about the rest of the things I asked? > > -- > > - Sahil Malik [MVP] > ADO.NET 2.0 book - > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > ---------------------------------------------------------------------------- > --------------- > > "WebBuilder451" <(E-Mail Removed)> wrote in message > news:EEB68FB4-1716-40FA-B172-(E-Mail Removed)... > > the haserrors on the usr table is comming back false > > -- > > thanks (as always) > > some day i''m gona pay this forum back for all the help i''m getting > > kes > > > > > > "Sahil Malik [MVP]" wrote: > > > > > What value does the HasErrors property on the DataTable have after you > run > > > DataAdapter.Update? > > > You can get the error per row as the RowError property, if you databind > it > > > to a datagrid it will appear as an exclamation mark and a relevant > tooltip. > > > > > > The exact reason for the error - more than likely your InsertCommand and > > > UpdateCommand are faulty. Check the CommandText for those two, using > either > > > debug mode, or SQL Profiler. > > > > > > - Sahil Malik [MVP] > > > ADO.NET 2.0 book - > > > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > > > > -------------------------------------------------------------------------- > -- > > > > > > > > > "WebBuilder451" <(E-Mail Removed)> wrote in > message > > > news:15CC24EE-05B6-4DB1-90A4-(E-Mail Removed)... > > > >i can get it to update if i set Me.daMem.ContinueUpdateOnError = True > > > > this being said how can i see the error? > > > > again please ANY advice on this would be appreciated > > > > -- > > > > thanks (as always) > > > > some day i''m gona pay this forum back for all the help i''m getting > > > > kes > > > > > > > > > > > > "WebBuilder451" wrote: > > > > > > > >> I've run into an interesting problem: > > > >> I have a very straight forward form that will update or insert > records > > > >> using > > > >> a dataadapter and a dataset. I worked fine until i changed the select > > > >> parameter. > > > >> i regenerated the dataset and configured the adapter. Now i can't > update > > > >> nor > > > >> insert > > > >> I can select fine, but when i insert or update the table does not get > > > >> updated. There are no errors just nothing. when i check for dataset > > > >> changes i > > > >> get a true. > > > >> ok here is the code (is there a bug or known issues with vs.net or > > > >> changing > > > >> sp's that will cause this?) > > > >> Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal > e > > > >> As > > > >> System.EventArgs) Handles lbtnUpdate.Click > > > >> Try > > > >> ' get the current data set with the row > > > >> Me.daMem.SelectCommand.Parameters(1).Value = > > > >> User.Identity.Name > > > >> Me.daMem.Fill(Me.DsMem1.usr) > > > >> ' set the values in the row and update > > > >> With Me.DsMem1.usr(0) > > > >> .usrFName = Me.txtFName.Text > > > >> .usrMI = Me.txtMi.Text > > > >> .usrLName = Me.txtLname.Text > > > >> .usrTitle = Me.txtTitle.Text > > > >> .usrEmail = Me.txtEmail.Text > > > >> .usrUrl = Me.txtURL.Text > > > >> .usrUserID = Me.txtUserID.Text > > > >> .usrPassword = Me.txtPswd.Text > > > >> .usrPhone = Me.txtPhone.Text > > > >> .usrWkPhone = Me.txtWkPhone.Text > > > >> .usrCellPhone = Me.txtCell.Text > > > >> .usrFax = Me.txtFax.Text > > > >> .usrCompany = Me.txtCompany.Text > > > >> .usrAddress = Me.txtAddress.Text > > > >> .usrCity = Me.txtCity.Text > > > >> .usrState = Me.ddlState.SelectedValue > > > >> .usrZip = Me.txtZip.Text > > > >> .usrMemType = Me.txtMemType.Text > > > >> .usrMemDate = Me.txtMemDate.Text > > > >> .usrExpDate = Me.txtMemExpDate.Text > > > >> .usrExtra1 = Me.txtExtra1.Text > > > >> .usrExtra2 = Me.txtExtra2.Text > > > >> .usrStatus = Me.chkStatus.Checked > > > >> End With > > > >> Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString > > > >> Me.lblMSG.Text &= Me.DsMem1.HasErrors() > > > >> Me.daMem.Update(Me.DsMem1) > > > >> ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + > > > >> Me.DsMem1.usr(0).usrID.ToString > > > >> Catch ex As Exception > > > >> Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> > > > >> <B>STACK > > > >> TRACE:</B> {1}", _ > > > >> ex.Message, ex.StackTrace) > > > >> Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + > > > >> "<br>" > > > >> + msg > > > >> End Try > > > >> End Sub > > > >> -- > > > >> thanks (as always) > > > >> some day i''m gona pay this forum back for all the help i''m getting > > > >> kes > > > > > > > > > > > > |
|
||
|
||||
|
=?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=
Guest
Posts: n/a
|
one last thing the sqlserver i'm using is being connected to via the web,
would this cause something like this with out a timeout error? thanks i know i'm asking a lot of questions kes -- thanks (as always) some day i''m gona pay this forum back for all the help i''m getting kes "Sahil Malik [MVP]" wrote: > Okay what about the rest of the things I asked? > > -- > > - Sahil Malik [MVP] > ADO.NET 2.0 book - > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > ---------------------------------------------------------------------------- > --------------- > > "WebBuilder451" <(E-Mail Removed)> wrote in message > news:EEB68FB4-1716-40FA-B172-(E-Mail Removed)... > > the haserrors on the usr table is comming back false > > -- > > thanks (as always) > > some day i''m gona pay this forum back for all the help i''m getting > > kes > > > > > > "Sahil Malik [MVP]" wrote: > > > > > What value does the HasErrors property on the DataTable have after you > run > > > DataAdapter.Update? > > > You can get the error per row as the RowError property, if you databind > it > > > to a datagrid it will appear as an exclamation mark and a relevant > tooltip. > > > > > > The exact reason for the error - more than likely your InsertCommand and > > > UpdateCommand are faulty. Check the CommandText for those two, using > either > > > debug mode, or SQL Profiler. > > > > > > - Sahil Malik [MVP] > > > ADO.NET 2.0 book - > > > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > > > > -------------------------------------------------------------------------- > -- > > > > > > > > > "WebBuilder451" <(E-Mail Removed)> wrote in > message > > > news:15CC24EE-05B6-4DB1-90A4-(E-Mail Removed)... > > > >i can get it to update if i set Me.daMem.ContinueUpdateOnError = True > > > > this being said how can i see the error? > > > > again please ANY advice on this would be appreciated > > > > -- > > > > thanks (as always) > > > > some day i''m gona pay this forum back for all the help i''m getting > > > > kes > > > > > > > > > > > > "WebBuilder451" wrote: > > > > > > > >> I've run into an interesting problem: > > > >> I have a very straight forward form that will update or insert > records > > > >> using > > > >> a dataadapter and a dataset. I worked fine until i changed the select > > > >> parameter. > > > >> i regenerated the dataset and configured the adapter. Now i can't > update > > > >> nor > > > >> insert > > > >> I can select fine, but when i insert or update the table does not get > > > >> updated. There are no errors just nothing. when i check for dataset > > > >> changes i > > > >> get a true. > > > >> ok here is the code (is there a bug or known issues with vs.net or > > > >> changing > > > >> sp's that will cause this?) > > > >> Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal > e > > > >> As > > > >> System.EventArgs) Handles lbtnUpdate.Click > > > >> Try > > > >> ' get the current data set with the row > > > >> Me.daMem.SelectCommand.Parameters(1).Value = > > > >> User.Identity.Name > > > >> Me.daMem.Fill(Me.DsMem1.usr) > > > >> ' set the values in the row and update > > > >> With Me.DsMem1.usr(0) > > > >> .usrFName = Me.txtFName.Text > > > >> .usrMI = Me.txtMi.Text > > > >> .usrLName = Me.txtLname.Text > > > >> .usrTitle = Me.txtTitle.Text > > > >> .usrEmail = Me.txtEmail.Text > > > >> .usrUrl = Me.txtURL.Text > > > >> .usrUserID = Me.txtUserID.Text > > > >> .usrPassword = Me.txtPswd.Text > > > >> .usrPhone = Me.txtPhone.Text > > > >> .usrWkPhone = Me.txtWkPhone.Text > > > >> .usrCellPhone = Me.txtCell.Text > > > >> .usrFax = Me.txtFax.Text > > > >> .usrCompany = Me.txtCompany.Text > > > >> .usrAddress = Me.txtAddress.Text > > > >> .usrCity = Me.txtCity.Text > > > >> .usrState = Me.ddlState.SelectedValue > > > >> .usrZip = Me.txtZip.Text > > > >> .usrMemType = Me.txtMemType.Text > > > >> .usrMemDate = Me.txtMemDate.Text > > > >> .usrExpDate = Me.txtMemExpDate.Text > > > >> .usrExtra1 = Me.txtExtra1.Text > > > >> .usrExtra2 = Me.txtExtra2.Text > > > >> .usrStatus = Me.chkStatus.Checked > > > >> End With > > > >> Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString > > > >> Me.lblMSG.Text &= Me.DsMem1.HasErrors() > > > >> Me.daMem.Update(Me.DsMem1) > > > >> ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + > > > >> Me.DsMem1.usr(0).usrID.ToString > > > >> Catch ex As Exception > > > >> Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> > > > >> <B>STACK > > > >> TRACE:</B> {1}", _ > > > >> ex.Message, ex.StackTrace) > > > >> Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + > > > >> "<br>" > > > >> + msg > > > >> End Try > > > >> End Sub > > > >> -- > > > >> thanks (as always) > > > >> some day i''m gona pay this forum back for all the help i''m getting > > > >> kes > > > > > > > > > > > > |
|
||
|
||||
|
Sahil Malik [MVP]
Guest
Posts: n/a
|
> shouldn't the row be in error if a column is in error?
Hmm .. ColumnError is generally not set through dataadapter, so I wouldn't worry about this just yet. "WebBuilder451" <(E-Mail Removed)> wrote in message news E1829D6-0FB7-4F24-8633-(E-Mail Removed)...> .... columnsinerror is length 0. > shouldn't the row be in error if a column is in error? > thanks > kes > -- > thanks (as always) > some day i''m gona pay this forum back for all the help i''m getting > kes > > > "Sahil Malik [MVP]" wrote: > > > Okay what about the rest of the things I asked? > > > > -- > > > > - Sahil Malik [MVP] > > ADO.NET 2.0 book - > > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > > -------------------------------------------------------------------------- -- > > --------------- > > > > "WebBuilder451" <(E-Mail Removed)> wrote in message > > news:EEB68FB4-1716-40FA-B172-(E-Mail Removed)... > > > the haserrors on the usr table is comming back false > > > -- > > > thanks (as always) > > > some day i''m gona pay this forum back for all the help i''m getting > > > kes > > > > > > > > > "Sahil Malik [MVP]" wrote: > > > > > > > What value does the HasErrors property on the DataTable have after you > > run > > > > DataAdapter.Update? > > > > You can get the error per row as the RowError property, if you databind > > it > > > > to a datagrid it will appear as an exclamation mark and a relevant > > tooltip. > > > > > > > > The exact reason for the error - more than likely your InsertCommand and > > > > UpdateCommand are faulty. Check the CommandText for those two, using > > either > > > > debug mode, or SQL Profiler. > > > > > > > > - Sahil Malik [MVP] > > > > ADO.NET 2.0 book - > > > > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > > > > > > -------------------------------------------------------------------------- > > -- > > > > > > > > > > > > "WebBuilder451" <(E-Mail Removed)> wrote in > > message > > > > news:15CC24EE-05B6-4DB1-90A4-(E-Mail Removed)... > > > > >i can get it to update if i set Me.daMem.ContinueUpdateOnError = True > > > > > this being said how can i see the error? > > > > > again please ANY advice on this would be appreciated > > > > > -- > > > > > thanks (as always) > > > > > some day i''m gona pay this forum back for all the help i''m getting > > > > > kes > > > > > > > > > > > > > > > "WebBuilder451" wrote: > > > > > > > > > >> I've run into an interesting problem: > > > > >> I have a very straight forward form that will update or insert > > records > > > > >> using > > > > >> a dataadapter and a dataset. I worked fine until i changed the select > > > > >> parameter. > > > > >> i regenerated the dataset and configured the adapter. Now i can't > > update > > > > >> nor > > > > >> insert > > > > >> I can select fine, but when i insert or update the table does not get > > > > >> updated. There are no errors just nothing. when i check for dataset > > > > >> changes i > > > > >> get a true. > > > > >> ok here is the code (is there a bug or known issues with vs.net or > > > > >> changing > > > > >> sp's that will cause this?) > > > > >> Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal > > e > > > > >> As > > > > >> System.EventArgs) Handles lbtnUpdate.Click > > > > >> Try > > > > >> ' get the current data set with the row > > > > >> Me.daMem.SelectCommand.Parameters(1).Value = > > > > >> User.Identity.Name > > > > >> Me.daMem.Fill(Me.DsMem1.usr) > > > > >> ' set the values in the row and update > > > > >> With Me.DsMem1.usr(0) > > > > >> .usrFName = Me.txtFName.Text > > > > >> .usrMI = Me.txtMi.Text > > > > >> .usrLName = Me.txtLname.Text > > > > >> .usrTitle = Me.txtTitle.Text > > > > >> .usrEmail = Me.txtEmail.Text > > > > >> .usrUrl = Me.txtURL.Text > > > > >> .usrUserID = Me.txtUserID.Text > > > > >> .usrPassword = Me.txtPswd.Text > > > > >> .usrPhone = Me.txtPhone.Text > > > > >> .usrWkPhone = Me.txtWkPhone.Text > > > > >> .usrCellPhone = Me.txtCell.Text > > > > >> .usrFax = Me.txtFax.Text > > > > >> .usrCompany = Me.txtCompany.Text > > > > >> .usrAddress = Me.txtAddress.Text > > > > >> .usrCity = Me.txtCity.Text > > > > >> .usrState = Me.ddlState.SelectedValue > > > > >> .usrZip = Me.txtZip.Text > > > > >> .usrMemType = Me.txtMemType.Text > > > > >> .usrMemDate = Me.txtMemDate.Text > > > > >> .usrExpDate = Me.txtMemExpDate.Text > > > > >> .usrExtra1 = Me.txtExtra1.Text > > > > >> .usrExtra2 = Me.txtExtra2.Text > > > > >> .usrStatus = Me.chkStatus.Checked > > > > >> End With > > > > >> Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString > > > > >> Me.lblMSG.Text &= Me.DsMem1.HasErrors() > > > > >> Me.daMem.Update(Me.DsMem1) > > > > >> ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + > > > > >> Me.DsMem1.usr(0).usrID.ToString > > > > >> Catch ex As Exception > > > > >> Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> > > > > >> <B>STACK > > > > >> TRACE:</B> {1}", _ > > > > >> ex.Message, ex.StackTrace) > > > > >> Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + > > > > >> "<br>" > > > > >> + msg > > > > >> End Try > > > > >> End Sub > > > > >> -- > > > > >> thanks (as always) > > > > >> some day i''m gona pay this forum back for all the help i''m getting > > > > >> kes > > > > > > > > > > > > > > > > > > |
|
||
|
||||
|
Sahil Malik [MVP]
Guest
Posts: n/a
|
Okay so now we need to figure out what the command text's are of the various
commands on your dataadapter. -- - Sahil Malik [MVP] ADO.NET 2.0 book - http://codebetter.com/blogs/sahil.ma.../13/63199.aspx ---------------------------------------------------------------------------- --------------- "WebBuilder451" <(E-Mail Removed)> wrote in message news:C877E65C-19F2-4344-9A0D-(E-Mail Removed)... > row is false also. > But now it is working and the continue on error is false. (?) > I did a check yesterday to see if the sp was getting called by harcoding a > paramter value and it showed that the sp was not getting called. It was as if > it were getting skipped. This has happened to me a few time and my guess is > that as you suggested it's an error in the table. I'd think a sql error would > give an exception. I would think that an error in the ds.table.row would also > throw an exception is this true or does it need to be checked? > thanks for your help > kes > > -- > thanks (as always) > some day i''m gona pay this forum back for all the help i''m getting > kes > > > "Sahil Malik [MVP]" wrote: > > > Okay what about the rest of the things I asked? > > > > -- > > > > - Sahil Malik [MVP] > > ADO.NET 2.0 book - > > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > > -------------------------------------------------------------------------- -- > > --------------- > > > > "WebBuilder451" <(E-Mail Removed)> wrote in message > > news:EEB68FB4-1716-40FA-B172-(E-Mail Removed)... > > > the haserrors on the usr table is comming back false > > > -- > > > thanks (as always) > > > some day i''m gona pay this forum back for all the help i''m getting > > > kes > > > > > > > > > "Sahil Malik [MVP]" wrote: > > > > > > > What value does the HasErrors property on the DataTable have after you > > run > > > > DataAdapter.Update? > > > > You can get the error per row as the RowError property, if you databind > > it > > > > to a datagrid it will appear as an exclamation mark and a relevant > > tooltip. > > > > > > > > The exact reason for the error - more than likely your InsertCommand and > > > > UpdateCommand are faulty. Check the CommandText for those two, using > > either > > > > debug mode, or SQL Profiler. > > > > > > > > - Sahil Malik [MVP] > > > > ADO.NET 2.0 book - > > > > http://codebetter.com/blogs/sahil.ma.../13/63199.aspx > > > > > > -------------------------------------------------------------------------- > > -- > > > > > > > > > > > > "WebBuilder451" <(E-Mail Removed)> wrote in > > message > > > > news:15CC24EE-05B6-4DB1-90A4-(E-Mail Removed)... > > > > >i can get it to update if i set Me.daMem.ContinueUpdateOnError = True > > > > > this being said how can i see the error? > > > > > again please ANY advice on this would be appreciated > > > > > -- > > > > > thanks (as always) > > > > > some day i''m gona pay this forum back for all the help i''m getting > > > > > kes > > > > > > > > > > > > > > > "WebBuilder451" wrote: > > > > > > > > > >> I've run into an interesting problem: > > > > >> I have a very straight forward form that will update or insert > > records > > > > >> using > > > > >> a dataadapter and a dataset. I worked fine until i changed the select > > > > >> parameter. > > > > >> i regenerated the dataset and configured the adapter. Now i can't > > update > > > > >> nor > > > > >> insert > > > > >> I can select fine, but when i insert or update the table does not get > > > > >> updated. There are no errors just nothing. when i check for dataset > > > > >> changes i > > > > >> get a true. > > > > >> ok here is the code (is there a bug or known issues with vs.net or > > > > >> changing > > > > >> sp's that will cause this?) > > > > >> Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal > > e > > > > >> As > > > > >> System.EventArgs) Handles lbtnUpdate.Click > > > > >> Try > > > > >> ' get the current data set with the row > > > > >> Me.daMem.SelectCommand.Parameters(1).Value = > > > > >> User.Identity.Name > > > > >> Me.daMem.Fill(Me.DsMem1.usr) > > > > >> ' set the values in the row and update > > > > >> With Me.DsMem1.usr(0) > > > > >> .usrFName = Me.txtFName.Text > > > > >> .usrMI = Me.txtMi.Text > > > > >> .usrLName = Me.txtLname.Text > > > > >> .usrTitle = Me.txtTitle.Text > > > > >> .usrEmail = Me.txtEmail.Text > > > > >> .usrUrl = Me.txtURL.Text > > > > >> .usrUserID = Me.txtUserID.Text > > > > >> .usrPassword = Me.txtPswd.Text > > > > >> .usrPhone = Me.txtPhone.Text > > > > >> .usrWkPhone = Me.txtWkPhone.Text > > > > >> .usrCellPhone = Me.txtCell.Text > > > > >> .usrFax = Me.txtFax.Text > > > > >> .usrCompany = Me.txtCompany.Text > > > > >> .usrAddress = Me.txtAddress.Text > > > > >> .usrCity = Me.txtCity.Text > > > > >> .usrState = Me.ddlState.SelectedValue > > > > >> .usrZip = Me.txtZip.Text > > > > >> .usrMemType = Me.txtMemType.Text > > > > >> .usrMemDate = Me.txtMemDate.Text > > > > >> .usrExpDate = Me.txtMemExpDate.Text > > > > >> .usrExtra1 = Me.txtExtra1.Text > > > > >> .usrExtra2 = Me.txtExtra2.Text > > > > >> .usrStatus = Me.chkStatus.Checked > > > > >> End With > > > > >> Me.lblMSG.Text = Me.DsMem1.HasChanges().ToString > > > > >> Me.lblMSG.Text &= Me.DsMem1.HasErrors() > > > > >> Me.daMem.Update(Me.DsMem1) > > > > >> ' Me.lblMSG.Text = Me.DsMem1.usr(0).usrFName + " " + > > > > >> Me.DsMem1.usr(0).usrID.ToString > > > > >> Catch ex As Exception > > > > >> Dim msg As String = String.Format("<B>MSG:</B> {0} <BR> > > > > >> <B>STACK > > > > >> TRACE:</B> {1}", _ > > > > >> ex.Message, ex.StackTrace) > > > > >> Me.lblMSG.Text = "<B>ERROR:</B> " & ex.GetType.ToString + > > > > >> "<br>" > > > > >> + msg > > > > >> End Try > > > > >> End Sub > > > > >> -- > > > > >> thanks (as always) > > > > >> some day i''m gona pay this forum back for all the help i''m getting > > > > >> kes > > > > > > > > > > > > > > > > > > |
|
||
|
||||
|
|
|
| |
![]() |
| Thread Tools | |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help - Problem Getting DataAdapter to update | Siv | Microsoft VB .NET | 11 | 29th Apr 2005 06:48 PM |
| DataAdapter Update problem | Santa's Anus | Microsoft Dot NET | 0 | 29th Nov 2004 02:08 PM |
| DataAdapter.Update Problem | =?Utf-8?B?SEtN?= | Microsoft ADO .NET | 1 | 4th Feb 2004 04:21 PM |
| DataAdapter/Update problem | Elmo | Microsoft ASP .NET | 2 | 8th Nov 2003 09:07 PM |
| Re: DataAdapter Update Problem | Bill Simakis | Microsoft ADO .NET | 2 | 29th Jul 2003 11:04 PM |
Powered by vBulletin®. Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2010, Crawlability, Inc. |




