DH
Programmer
- Dec 8, 2000
- 168
Hello,
I am using the following code to create a dataTable:
Once the datatable is populated, I allow users to select which IDs the user would acutally like to email. I retreive the selected ID's as an array (or comma-delimited string).
I would like to delete the rows in the original datatable that are not in the array (or comma-delimited string)
Does anyone have any suggestions or examples.
Thanks,
DH
I am using the following code to create a dataTable:
Code:
Shared Function GetDataTable() As DataTable
Dim da As SqlDataAdapter
Dim ds As New DataSet
Dim sConn As String = ConfigurationSettings.AppSettings("SqlConnection1.ConnectionString")
Dim oConn As New SqlConnection(sConn)
Dim sqlcmd As New SqlCommand
'Prepare command object
sqlcmd.Connection = oConn
sqlcmd.CommandType = CommandType.StoredProcedure
sqlcmd.Parameters.Add("@allIDs", session("IDs")
sqlcmd.CommandText = "Read_Emails"
da = New SqlDataAdapter(sqlcmd)
da.Fill(ds, "tblMailMerge")
Dim dtMailMerge As DataTable = ds.Tables(0)
Return dtMailMerge
End Function
Once the datatable is populated, I allow users to select which IDs the user would acutally like to email. I retreive the selected ID's as an array (or comma-delimited string).
I would like to delete the rows in the original datatable that are not in the array (or comma-delimited string)
Does anyone have any suggestions or examples.
Thanks,
DH