日期:2014-05-18  浏览次数:20436 次

第 1 行: 'form' 附近有语法错误。
查了好久,都不懂错在哪,程序提示:
第   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();


------解决方案--------------------
select top 1 * form ttxtea_img where ImgCategoryId=@Cid and id=@id ";
---> > > > >
select top 1 * from ttxtea_img where ImgCategoryId=@Cid and id=@id ";

------解决方案--------------------
'form '

From