查了好久,都不懂错在哪,程序提示:
第 1 行: 'form' 附近有语法错误。
行 31: ad.Fill(ds);
代码如下: SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLConnString1"].ConnectionString); string strsql = "select top 1 * form ttxtea_img where ImgCategoryId=@Cid and id=@id"; SqlDataAdapter ad = new SqlDataAdapter(strsql, conn); ad.SelectCommand.Parameters.Add(new SqlParameter("@Cid", SqlDbType.Int, 4));
ad.SelectCommand.Parameters["@Cid"].Value = Request.QueryString["Cid"];
ad.SelectCommand.Parameters.Add(new SqlParameter("@id", SqlDbType.Int, 4));
ad.SelectCommand.Parameters["@id"].Value = Request.QueryString["id"]; DataSet ds = new DataSet();
ad.Fill(ds); FormView1.DataSource = ds;
FormView1.DataBind();
conn.Close();
第 1 行: 'form' 附近有语法错误。
行 31: ad.Fill(ds);
代码如下: SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLConnString1"].ConnectionString); string strsql = "select top 1 * form ttxtea_img where ImgCategoryId=@Cid and id=@id"; SqlDataAdapter ad = new SqlDataAdapter(strsql, conn); ad.SelectCommand.Parameters.Add(new SqlParameter("@Cid", SqlDbType.Int, 4));
ad.SelectCommand.Parameters["@Cid"].Value = Request.QueryString["Cid"];
ad.SelectCommand.Parameters.Add(new SqlParameter("@id", SqlDbType.Int, 4));
ad.SelectCommand.Parameters["@id"].Value = Request.QueryString["id"]; DataSet ds = new DataSet();
ad.Fill(ds); FormView1.DataSource = ds;
FormView1.DataBind();
conn.Close();
解决方案 »
- =====分不多了,求教一个excel数据导入datagridview的问题=====
- System.IndexOutOfRangeException: 索引超出了数组界限。
- App_Data文件夹里新建类using问题!!!!!
- 在用VS2005.NET 制作网站的时候,出现“编译器失败,错误代码为 -1073741819”
- 简单的正则表达式
- 求教JS日期选择器问题
- 求助关于vs.net2003和vs2005共存的问题
- TextChanged事件里如何判断文本框输入的值?
- 简单客户脚本问题
- .net 示例学习网,寻求建设指导!!
- GridView模板别 中使用iframe高度自适问题,顶者有分(第2次发贴)
- 请教css技术问题
--->>>>>
select top 1 * from ttxtea_img where ImgCategoryId=@Cid and id=@id";