ok eccolo
La funzione mi ritorna l'id della campagna
Private Function NuovaCampagna(ByVal inName As String) As Integer
Dim retVal As Integer
Me.CAMPAIN_COUNTERTableAdapter.Fill(Me.DB.CAMPAIN_COUNTER)
Me.CAMPAIN_ATTACHMENTSTableAdapter.Fill(Me.DB.CAMPAIN_ATTACHMENTS)
Try
Dim tRv As DataRowView = Me.CAMPAINCOUNTERBindingSource.AddNew()
tRv("CMPNAME") = inName
retVal = tRv("IDCAMPAIN")
Return retVal
Catch ex As Exception
Throw ex
End Try
End Function
Poi un un altro punto chiamo questo pezzo di codice
Dim tRv As DataRowView = Me.CAMPAIN_ATTACHMENTSBindingSource.AddNew
tRv("IDCAMPAIN") = idCampain
tRv("ATTFILE") = theContent
per inserire i dati in un altra tabella