none
Tableadapter.update not updating the database RRS feed

  • Question

  • I am atempting to update a database using the below code. I do not have a local copy of the database. For the life of me I can't get it to update. Any idea's?

    Module

    Module1

    Private ds As New database_RejectlistDataSet

    Private ta As New database_RejectlistDataSetTableAdapters.RejectListTableAdapter

    ' Private dt As New DataTable

    Sub Main()

    ta.Fill(ds.RejectList)

    Dim newRejectListRow As Hmailserver_RejectlistDataSet.RejectListRow

    newRejectListRow = ds.RejectList.NewRejectListRow

    newRejectListRow.Address = "xxd@gmail.com"

    Try

    ds.RejectList.Rows.Add(newRejectListRow)

    Catch ex As System.Data.ConstraintException

     

    Console.WriteLine()

    End Try

    Dim rl = ds.Tables("RejectList").AsEnumerable

     

    Dim query = From n In rl _

    Select n

    ta.Update(ds.RejectList)

    End Sub

    End

     

    Module


    If I use this same code in a Windows Project instead of a Console Project eveything works.... Why?

    Best Regards

    Sunday, May 3, 2009 2:08 AM

Answers

All replies