<%@ Page Language="C#" AutoEventWireup="true" CodeFile="postreplyadmin.aspx.cs" Inherits="postreplay" MasterPageFile="~/AdminMaster.master" Title="Post-Reply Page"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<%
String postid = Request.QueryString["id"];
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["civilRegDB"].ConnectionString);
con.Open();
String sql = "select * from Forumthread where PostID=" + postid;
SqlDataAdapter da=new SqlDataAdapter(sql,con);
DataSet ds=new DataSet();
da.Fill(ds);
DataRow drow = ds.Tables[0].Rows[0];
String name = drow["Name"].ToString();
String desc = drow["Description"].ToString();
DateTime dt = Convert.ToDateTime(drow["PostDate"].ToString());
String postdate = dt.ToString("dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture );
String mailid = drow["Email"].ToString();
%>
</asp:content>
我在尝试回复帖子时收到 sqlexception。错误:'=' 附近的语法不正确。我环顾四周寻找与我类似的其他问题,但我找不到任何对我有价值的东西。
我在“da.fill(ds);”上遇到错误。任何人都可以帮助我解决这个问题...... :(