各位帮忙看下 这几个页面有语法错误吗 系统一直提示有语法错误: ”da.Fill(ds);第 1 行: '=' 附近有语法错误 “但是我没看出来 谢谢了这是前台页面 Describe.aspx<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Describe.aspx.cs" Inherits="Describe" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>详细信息</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="637">
<tr>
<td style="background-image: url(Image/购物车/子页头.jpg); width: 637px; height: 120px"
valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" style="width: 383px">
<tr>
<td style="width: 103px">
</td>
<td>
<asp:Image ID="Image1" runat="server" ImageUrl="~/Image/购物车/详细信息.jpg" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="background-image: url(Image/购物车/子页中间.jpg); width: 637px; height: 341px">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="font-size: 10pt;
width: 352px">
<tr>
<td align="left" style="width: 200px">
商品名称:</td>
<td style="width: 359px">
<asp:TextBox ID="txtGoodsName" runat="server" Enabled="False"></asp:TextBox>
<font color="red"></font>
</td>
</tr>
<tr style="color: #000000">
<td align="left" style="width: 200px">
商品类别:</td>
<td style="width: 359px">
<asp:TextBox ID="txtKind" runat="server" Enabled="False"></asp:TextBox>
</td>
</tr>
<tr style="color: #000000">
<td align="left" style="width: 200px; height: 19px">
商品价格:
</td>
<td colspan="3" style="width: 269px; height: 19px">
<asp:TextBox ID="txtGoodsPrice" runat="server" Enabled="False">0</asp:TextBox>¥</td>
</tr>
<tr>
<td align="left" style="width: 200px; height: 87px">
商品图像:
</td>
<td colspan="3" style="width: 269px; height: 87px">
<asp:Image ID="imgGoodsPhoto" runat="server" Height="103px" Width="90px">
</asp:Image>
</td>
</tr>
<tr>
<td align="left" style="width: 200px; height: 97px">
商品介绍:
</td>
<td style="width: 359px; height: 97px">
<asp:TextBox ID="txtGoodsDesc" runat="server" Height="84px" TextMode="MultiLine"
Width="245px" Enabled="False"></asp:TextBox></td>
</tr>
<tr>
<td align="left" colspan="2" style="height: 8px">
<asp:Button ID="btnClose" runat="server" OnClick="btnClose_Click" Text="关闭" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="background-image: url(Image/购物车/子页底.jpg); width: 637px; height: 140px">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>这是后台页面 Describe.aspx.csusing System;
using System.Data;
using System.Configuration;
using System.Collections;
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;public partial class Describe : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string P_str_GoodsID = Request["GoodsID"]; //定义一个变量 P_str_GoodsID并赋值给它
DataSet ds = DB.reDs("select * from tb_GoodsInfo where GoodsID=" + P_str_GoodsID);
txtGoodsName.Text = ds.Tables[0].Rows[0][1].ToString(); //这个是给一个文本框或者文本标签复制
txtKind.Text = ds.Tables[0].Rows[0][2].ToString();
imgGoodsPhoto.ImageUrl = ds.Tables[0].Rows[0][3].ToString();
txtGoodsPrice.Text = ds.Tables[0].Rows[0][4].ToString();
txtGoodsDesc.Text = ds.Tables[0].Rows[0][5].ToString();
}
//关闭窗口
protected void btnClose_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();</script>");
}
}
<head id="Head1" runat="server">
<title>详细信息</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="637">
<tr>
<td style="background-image: url(Image/购物车/子页头.jpg); width: 637px; height: 120px"
valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" style="width: 383px">
<tr>
<td style="width: 103px">
</td>
<td>
<asp:Image ID="Image1" runat="server" ImageUrl="~/Image/购物车/详细信息.jpg" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="background-image: url(Image/购物车/子页中间.jpg); width: 637px; height: 341px">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="font-size: 10pt;
width: 352px">
<tr>
<td align="left" style="width: 200px">
商品名称:</td>
<td style="width: 359px">
<asp:TextBox ID="txtGoodsName" runat="server" Enabled="False"></asp:TextBox>
<font color="red"></font>
</td>
</tr>
<tr style="color: #000000">
<td align="left" style="width: 200px">
商品类别:</td>
<td style="width: 359px">
<asp:TextBox ID="txtKind" runat="server" Enabled="False"></asp:TextBox>
</td>
</tr>
<tr style="color: #000000">
<td align="left" style="width: 200px; height: 19px">
商品价格:
</td>
<td colspan="3" style="width: 269px; height: 19px">
<asp:TextBox ID="txtGoodsPrice" runat="server" Enabled="False">0</asp:TextBox>¥</td>
</tr>
<tr>
<td align="left" style="width: 200px; height: 87px">
商品图像:
</td>
<td colspan="3" style="width: 269px; height: 87px">
<asp:Image ID="imgGoodsPhoto" runat="server" Height="103px" Width="90px">
</asp:Image>
</td>
</tr>
<tr>
<td align="left" style="width: 200px; height: 97px">
商品介绍:
</td>
<td style="width: 359px; height: 97px">
<asp:TextBox ID="txtGoodsDesc" runat="server" Height="84px" TextMode="MultiLine"
Width="245px" Enabled="False"></asp:TextBox></td>
</tr>
<tr>
<td align="left" colspan="2" style="height: 8px">
<asp:Button ID="btnClose" runat="server" OnClick="btnClose_Click" Text="关闭" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="background-image: url(Image/购物车/子页底.jpg); width: 637px; height: 140px">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>这是后台页面 Describe.aspx.csusing System;
using System.Data;
using System.Configuration;
using System.Collections;
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;public partial class Describe : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string P_str_GoodsID = Request["GoodsID"]; //定义一个变量 P_str_GoodsID并赋值给它
DataSet ds = DB.reDs("select * from tb_GoodsInfo where GoodsID=" + P_str_GoodsID);
txtGoodsName.Text = ds.Tables[0].Rows[0][1].ToString(); //这个是给一个文本框或者文本标签复制
txtKind.Text = ds.Tables[0].Rows[0][2].ToString();
imgGoodsPhoto.ImageUrl = ds.Tables[0].Rows[0][3].ToString();
txtGoodsPrice.Text = ds.Tables[0].Rows[0][4].ToString();
txtGoodsDesc.Text = ds.Tables[0].Rows[0][5].ToString();
}
//关闭窗口
protected void btnClose_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();</script>");
}
}
这句,GoodsID是什么类型?
如果是字符串,那么改如下:
DataSet ds = DB.reDs("select * from tb_GoodsInfo where GoodsID='" + P_str_GoodsID + "'");