الاخوه الاعزاء في المنتدى
تواجهني مشكله هامه جدا في التالي:
-ما أفوم به هو باستخدام ال asp.net
انشاء web تقرأ من datasource بيانات في dataset من ثم اعدل واضيف والغي من هذه ال dataset
ثم انقل كل التغييرات مرة واحده الى datasource
i wrote this peace of code:
Dim DS As New DataSet()
Dim DA As New SqlDataAdapter()
Dim CONN As New SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind ")
Dim CMDSELECT As New SqlCommand()
Dim DROW As DataRow
Dim DTABLE As DataTable
CMDSELECT.Connection = CONN
CMDSELECT.CommandText = " SELECT * FROM employees "
DA.SelectCommand = CMDSELECT
DA.Fill(DS, "Employees")
DTABLE = DS.Tables("Employees")
DROW = DTABLE.NewRow()
DROW.Item(0) = 55
.
.
.
DTABLE.Rows.Add(DROW)
Dim ADROW As DataRow() = DS.Tables("Employees").Select(Nothing, Nothing, DataViewRowState.Added)
DA.Update(ADROW)لكن يعطه هذا ال error
اقتباسUpdate requires a valid InsertCommand when passed DataRow collection with new rows.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Update requires a valid InsertCommand when passed DataRow collection with new rows.
Source Error:
da.update(adrow)
pls i need help on that