on Button click()
AddEmailCampaign(ToAddresses, Subject, Content, FileUpload1.FileName,CreatedDates);
then,
void AddEmailCampaign(List<string> ToAddresses, string Subject, string Content, string filename, DateTime CreatedDates)
{
CRMEntities dc = new CRMEntities();
tbl_EmailCampaign tbl = new tbl_EmailCampaign();
//What is the LINQ way to join a string array
tbl.Toaddress = String.Join(",", ToAddresses.ToArray()); // To Split The Array
tbl.Subject = Subject;
tbl.Contents = Content;
tbl.Attachments = filename;
tbl.CreatedDate = CreatedDates;
dc.tbl_EmailCampaign.AddObject(tbl);
dc.SaveChanges();
}
AddEmailCampaign(ToAddresses, Subject, Content, FileUpload1.FileName,CreatedDates);
then,
void AddEmailCampaign(List<string> ToAddresses, string Subject, string Content, string filename, DateTime CreatedDates)
{
CRMEntities dc = new CRMEntities();
tbl_EmailCampaign tbl = new tbl_EmailCampaign();
//What is the LINQ way to join a string array
tbl.Toaddress = String.Join(",", ToAddresses.ToArray()); // To Split The Array
tbl.Subject = Subject;
tbl.Contents = Content;
tbl.Attachments = filename;
tbl.CreatedDate = CreatedDates;
dc.tbl_EmailCampaign.AddObject(tbl);
dc.SaveChanges();
}