日期:2014-05-17 浏览次数:20546 次
DB db = new DB();
int i;
string lsql = "select max([ID]) from AttachmentTab";
SqlConnection con = db.GetCon();
con.Open();
SqlCommand cmd = new SqlCommand(lsql, con);
SqlDataReader Qcmd = cmd.ExecuteReader();
while (Qcmd.Read())
{
//Label3.Text = Qcmd[0].ToString();
i = int.Parse(Qcmd[0].ToString()) + 1;
}
Qcmd.Close();
con.Close();
///创建文件目录
string sPath = Server.MapPath(".") + "/upload/" + DateTime.Now.ToString("yyyy-MM").Replace("-", "") + "/"+i.ToString();
DB db = new DB();
string lsql = "select max([ID]) from AttachmentTab";
SqlConnection con = db.GetCon();
con.Open();
SqlCommand cmd = new SqlCommand(lsql, con);
int i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();