0
我正在使用UltraGrid在表中插入數據。問題是我需要插入,更新,刪除Web服務。我從Web服務獲取dataSet並將其顯示到網格中,但是當我在網格上進行一些更改(例如插入或更新數據)時,還需要將新的dataSet發送到Web服務,以便Web服務執行更新數據。Web服務中的數據集
這是表 ID(PK,INT,不爲空) 名稱(nvarchar的100,NULL)
這是爲客戶端的代碼:
Public Sub Refresh()
Dim p As localhost.Service1 = New localhost.Service1
'bind datatable to UltraGrid
UltraGrid1.DataSource = p.GetData()
End Sub
這是代碼從表中獲取數據的Web服務:
<WebMethod()> Public Function GetData() As DataSet
Dim custDA As SqlDataAdapter = New SqlDataAdapter("SELECT ID,Name FROM Btable", nwindConn)
Dim custDS As DataSet = New DataSet()
custDA.MissingSchemaAction = MissingSchemaAction.AddWithKey
custDA.Fill(custDS, "Btable")
GetData= custDS
End Function
這一切都工作正常,但現在我要插入新行線併發送至Web服務的nd從那裏插入它。我該怎麼做?謝謝!
-1用於建議使用@@ Identity而不是Scope_Identity()。在你解決問題後,我會給你回覆。 – ErikE 2010-02-19 02:33:22
謝謝。如果您在開始時使用@Emtucifor發表評論,這會有所幫助,因此我會收到通知(以防忘記回來查看)。 – ErikE 2010-02-22 17:58:24