SqlHelper 问题 if (type == "jpg" || type == "gif" || type == "bmp" || type == "png") { //打开连接对象 S601_myConn.Open(); FileUpload1.SaveAs(ipath);//服务器保存路径 SqlHelper.ExecuteNonQuery(S601_sql);
S601_myConn.Close(); } string query2 = "select * from Image where iid=" + Convert.ToInt32(TextBox1.Text); //创建数据源执行命令 SqlCommand cmd = new SqlCommand(query2, S601_myConn); SqlDataReader sdr = string query2 = "select * from Image where iid=" + Convert.ToInt32(TextBox1.Text); SqlDataReader sdr = SqlHelper.ExecuteReader(query2); 我在做把图片依路径形式存到数据库,在使用SqlHelper时提示不包含ExecuteReader,ExecuteNonQuery,但是我已经有了SqlHelper.cs,内容如下:using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
/// <summary> /// SqlHelper 的摘要说明 /// </summary> public class SqlHelper { public SqlHelper() { } }