電話すると
TA.Update(row)
次のエラーが表示されますが、デバッグ方法がわかりません。どの正確なフィールドが問題を引き起こしているかを特定する方法はありますか?
「/」アプリケーションでサーバー エラーが発生しました。
入力文字列は、正しい形式ではありませんでした。
説明: 現在の Web 要求の実行中に未処理の例外が発生しました。エラーの詳細とコード内のどこでエラーが発生したかについては、スタック トレースを確認してください。
例外の詳細: System.FormatException: 入力文字列が正しい形式ではありませんでした。
ソース エラー:
行 7381: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ 行 7382: パブリック オーバーロード オーバーライド可能な関数 Update(ByVal dataRow As Global.System.Data.DataRow) As Integer 行 7383: Return Me .Adapter.Update(New Global.System.Data.DataRow() {dataRow}) 行 7384: 関数の終了行 7385:
ソース ファイル: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\aebf90fc\865092c3\App_Code.6h2d5goz.23.vb 行: 7383
スタックトレース:
[FormatException: 入力文字列が正しい形式ではありませんでした。] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14365689 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info ) +305 System.Convert.ChangeType(オブジェクト値、型変換タイプ、IFormatProvider プロバイダー) +859 System.Data.SqlClient.SqlParameter.CoerceValue(オブジェクト値、MetaType destinationType、Boolean& coercedToDataFeed、Boolean& typeChanged、Boolean allowStreaming) +1809
[FormatException: パラメータ値を文字列から Int32 に変換できませんでした。] System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) +2290668 System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent、BatchCommandInfo[] batchCommands、Int32 commandCount) +75 System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows、DataTableMapping tableMapping) +3479 System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows) +319 adsTableAdapters .adsTableAdapter.Update(DataRow dataRow) in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\aebf90fc\865092c3\App_Code.6h2d5goz.23.vb:7383 editad.lbSaveLocation_Click(Object C:\Dropbox\inetpub\zz\editad.aspx.vb:765 System.Web の送信者、EventArgs e)。UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +153 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
そのようなエラーのチェックを追加しようとしましたが、エラーは発生しません:
Try
If TA.Update(row) = 1 Then
End If
Catch ex As Exception
Dim arr As Array = row.Table.GetErrors()
'arr.length=1 here
If arr.Length > 0 Then
lblStatus.Text = row.Table.GetErrors(0).ToString
'the value of row.Table.GetErrors(0).ToString is "ads+adsRow"
End If
End Try