<%@ 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);」上收到錯誤消息。任何人都可以幫我這個... :(
有帖子ID值。但我仍然收到錯誤.. – user2369497 2013-05-10 10:11:12
postid的值是多少? – Kami 2013-05-10 10:11:56
其int數據類型 – user2369497 2013-05-10 10:19:12