Re: [ASP ] 應用程式中發生伺服器錯誤

看板Visual_Basic作者 (小雨)時間19年前 (2006/06/04 12:57), 編輯推噓4(403)
留言7則, 2人參與, 最新討論串2/2 (看更多)
回版大「connectionstring中的帳號等於 sql_server中的嗎」 去重新設定sql server裡的test資料庫 test資料庫的使用者,除了dbo,另一個就是rain 在新增連接的時候,登入id、password時都沒錯,也順利連線 但不知為啥~執行的結果仍是「rain的登入失敗」 看了ConnectionString,少了password的部份 自己補上password,執行後的結果變成 --------------------------------------------------------------------------- 例外詳細資訊: System.Data.SqlClient.SqlException: 行 1: 'value' 附近的語法不正確。 原始程式錯誤: 行 62: SqlCommand1.CommandText = "insert into test(class,test_time,title, summary,article,author)value('" & class_text & "',getdate(),'" & txt1.\ Text & "','" & txt2.Text & "','" & txt3.Text & "','" & txt4.Text & "')" 行 63: 行 64: SqlCommand1.ExecuteNonQuery() 行 65: 行 66: Response.Write("SQL指令---" & SqlCommand1.CommandText & "<hr>") --------------------------------------------------------------------------- 真不好意思~麻煩版大了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.73.237.109

06/04 13:10, , 1F
values 少了s...
06/04 13:10, 1F

06/04 13:49, , 2F
對耶!謝謝~可是加上S之後變成=> 無效的物件名稱 'test'
06/04 13:49, 2F

06/04 14:45, , 3F
很抱歉~我的問題很爛...浪費大家的時間
06/04 14:45, 3F

06/04 14:48, , 4F
test資料庫裡面有test資料表嗎?
06/04 14:48, 4F

06/04 15:00, , 5F
抱歉~我只單看ASP.NET的書,所以sql server部份不懂
06/04 15:00, 5F

06/04 15:09, , 6F
結果是連線跟資料表沒設好..現在都可以執行了~謝謝大家
06/04 15:09, 6F

06/04 15:09, , 7F
的熱心和耐心指導
06/04 15:09, 7F
文章代碼(AID): #14WcX85O (Visual_Basic)
文章代碼(AID): #14WcX85O (Visual_Basic)