SqlConnection mycon = new SqlConnection(ConfigurationManager.AppSettings["Connstr"]);
string SQL = "select ImageUrl from gonggaoxinxi where zhanhui_id='" + e.CommandName + "'";
SqlCommand cmd = new SqlCommand(SQL,mycon);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@zhanhui_id",SqlDbType.Int);
cmd.Parameters["@zhanhui_id"].Value = SQL;
mycon.Open();
string filePath = @"images\NewsPic\" + cmd.ExecuteScalar().ToString();
if(File.Exists(filePath))
{
File.Delete(filePath) ;
}
string SQL = "select ImageUrl from gonggaoxinxi where zhanhui_id='" + e.CommandName + "'";
SqlCommand cmd = new SqlCommand(SQL,mycon);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@zhanhui_id",SqlDbType.Int);
cmd.Parameters["@zhanhui_id"].Value = SQL;
mycon.Open();
string filePath = @"images\NewsPic\" + cmd.ExecuteScalar().ToString();
if(File.Exists(filePath))
{
File.Delete(filePath) ;
}
解决方案 »
- 根据年显示该年中各个月的第一天和最后一天
- 向高手请教: Appdomain.Load()最终只能加载DLL文件吗? 如果已有Assembly对象,能够加载吗?怎样做呢?
- 大牛们指教一下 C# IList<T>的类型能是一个list吗??
- 如何C#的16进位转10进位
- 模板列中怎样控制超级链接的颜色?
- 高分求投票系统源码,或例子都行
- 我有个PDF417的代码,但是我不懂是怎么实现的,谁能讲一下算法
- C#中怎样设置dataGrid中的行高
- 一个FORM分两个区域,左边一个是一个Tree,如何在选中某一个节点后,让右边区域全部改掉,也就是换成另外一个控件.
- 急!如何上传静态HTML文件,并将其中的图片一起上传到服务器?
- ie7.0下面如何关闭页面问题?
- 求设计模式的关键词
string SQL = "select ImageUrl from gonggaoxinxi where zhanhui_id=@zhanhui_id";
SqlCommand cmd = new SqlCommand(SQL,mycon);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@zhanhui_id",SqlDbType.Int);
cmd.Parameters["@zhanhui_id"].Value = e.CommandName;
mycon.Open();
string filePath = @"images\NewsPic\" + cmd.ExecuteScalar().ToString();
if(File.Exists(filePath))
{
File.Delete(filePath) ;
}