以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 使用SQL语句生成数据表作为邮件内容 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=193447) |
-- 作者:知鸟 -- 发布时间:2024/9/14 12:44:00 -- 使用SQL语句生成数据表作为邮件内容 使用SQL语句生成数据表作为邮件内容 Dim m As New MailSender m.Host = "smtp.qq.com" m.Account = "xxx@xxx.com" m.Password = "swyyxxxxabd" m.From = "xxx@xxx.com" m.EnableSsl = True m.Port= "25" m.To ="xxx@xx.com" m.Encoding = Encoding.UTF8 m.Title = "工作报告" m.C m.SendAsync() Dim cmd As new SQLCommand cmd.C Dim dt As DataTable Dim sql As String = "sel ect form_id 表单编号,form_name 表单名称,eqp_id 设备编号,mat_id 物料编号,count(form_id) 点检记录数 ,count( case when isOutSpec = 1 then 1 end ) 超标记录数 from V_ems_checklist_reco where " & filter.trim("\'") & " group by form_id,form_name,eqp_id,mat_id" cmd.CommandText = sql dt = cmd.ExecuteReader() t1.DataSource = dt |
-- 作者:有点蓝 -- 发布时间:2024/9/14 13:35:00 -- MailSender不支持这种功能,换种方法:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=108607&skin=0 |