JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » .Net Framework  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 asp 語法錯誤問題
wilsonng5a2





發文: 2
積分: 0
於 2008-10-23 01:47 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
INSERT INTO 陳述式的語法錯誤。

I don't know what is the problem.

<%@ Import Namespace="System.Data.OleDb" %>
<%@ Page Language="C#" Debug="true" %>

<script language="C#" runat="server">

// public attributes for the user control
public string uploadText="Upload file:";
public string saveText="Save as:";
public string statusText="Status:";
public string submitText="Upload File";
public string uploadFolder="c:\\asp\\081022\\test1\\upload\\";

public void Page_Load(Object sender, EventArgs e) {

String abc=(String)filename.Value;
     String def=(String)savename.Value;
// move attributes into the form
upSpan.InnerText=uploadText;
saveSpan.InnerText=saveText;
statusSpan.InnerText=statusText;
uploadBtn.Value=submitText;

     OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" +
        "User ID=Admin;Data Source='" +
        Request.PhysicalApplicationPath +
        "081022/test1/database/fileupload.mdb';");
  string sql = "insert into filedesc (file,desc) values ('abc', 'def')";
  OleDbCommand cmd = new OleDbCommand(sql, conn);
cmd.Parameters.Add("@abc", OleDbType.VarChar).Value = abc;
  cmd.Parameters.Add("@def", OleDbType.VarChar).Value = def;
  conn.Open();
  cmd.ExecuteNonQuery();
  conn.Close();
}


wilsonng5a2 edited on 2008-10-23 01:53
reply to postreply to post
作者 Re:asp 語法錯誤問題 [Re:wilsonng5a2]
flowerdance





發文: 4
積分: 0
於 2008-11-16 23:45 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
应该是

string sql = "insert into filedesc (file,desc) values (@abc, @def)";


reply to postreply to post
» JWorld@TW »  .Net Framework

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8