注册 登录
编程论坛 ASP.NET技术论坛

(急用)数据怎么发送到邮箱上

梦的守护神 发布于 2007-03-14 15:47, 456 次点击
我想从数据库中读出一条数据他会自动发送到邮箱去   那代码该怎么写
2 回复
#2
梦的守护神2007-03-14 18:00
怎么都没人解决    斑竹
#3
小恶魔2007-03-14 20:16

C#.net
using System.Data.SqlClient;

page_load(){
try
{
string du;
SqlConnection con=new SqlConnection("server=.;uid=[自己写];pwd=[];database=[]");
Con.open();
SqlCommand cmd=new SqlCommand("select * from [表]",con);
SqlDataReader read;
read=cmd.ExecuteReader();
read.Read();
du=read.GetValue(0),ToString();
read.close();
//du是数据,(不完善的数据)
}
catch(Exception)
{
this.response.write("读数据失败");
read.close();
}
con.close();

只能先写到这了,因为VS2003昨天坏掉了,所有这都是刚写的,不要复制,可能有错误!只供参考!

[此贴子已经被作者于2007-3-14 20:17:25编辑过]

1