Difficulty: Beginner
Estimated Time: 10 minutes

Imports System Imports System.Data Imports System.Data.DataSetExtensions Imports System.Xml Imports System.Collections Imports System.Collections.Generic

Imports System.Linq

Public Module Module1 Public Sub Main() Dim dt = New DataTable() dt.Columns.Add("Name") dt.Columns.Add("Description") dt.Columns.Add("email") Dim dr = dt.NewRow() dr(0) = "Jk" dr(1) = "janakana" dr(2) = "[email protected]" dt.Rows.Add(dr) dr = dt.NewRow() dr(0) = "Jk1" dr(1) = "janakana2" dr(2) = "[email protected]" dt.Rows.Add(dr) dr = dt.NewRow() dr(0) = "Jk23" dr(1) = "janakana23" dr(2) = "[email protected]" dt.Rows.Add(dr) Console.WriteLine(dt.Columns.Count) Console.WriteLine(dt.Rows.Count) Dim dtEn = dt.AsEnumerable()

Dim grps = dtEn.GroupBy(Function(tbl) tbl("email")) _ .Select(Function(tbl){ tbl.Key,tbl.ToList() }).ToList()

 Console.WriteLine(grps) 
  

For Each g In grps Console.WriteLine(g(0))

 Dim listDr as List(Of DataRow)
   listDr = g(1)
   Dim name =listDr.Select(Function(row) row(0) )
     Console.WriteLine(name)
  For Each dr in g(1)
   Console.WriteLine(dr(0))
  Next
  
      Next
  

End Sub End Module

Outlook.Application app = new Outlook.Application(); Outlook.MailItem mailItem = app.CreateItem(Outlook.OlItemType.olMailItem); mailItem.Subject = "This is the subject"; mailItem.To = "[email protected]"; mailItem.Body = "This is the message."; mailItem.Attachments.Add(logPath);//logPath is a string holding path to the log.txt file mailItem.Importance = Outlook.OlImportance.olImportanceHigh; mailItem.Display(false);

Don’t stop now! The next scenario will only take about 10 minutes to complete.

outlook

App