 |
|
Operation must use an updateable query ได้มาไง งง? |
|
 |
|
|
 |
 |
|
มันน่าจะมี Error บอกมากกว่านี้นะครับ ช่วยเอามาให้หมดเลยครับ
|
 |
 |
 |
 |
Date :
2009-07-21 13:22:08 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Database น่าจะ ReadOnly หรือไม่มีสิทธิ์ในการแก้ไข/เพิ่ม ข้อมูลครับ
|
 |
 |
 |
 |
Date :
2009-07-21 13:23:24 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมอยากลองแก้ที่ ไฟล์เป็น read only ก่อน ลอง คลิ๊กขวาที่ folder จากนั้น ไป property เอา Tick ที่Read onlyออก
click apply then click Ok ทำแล้ว ก็ลองทำใหม่เพื่อcheckดู ไปที่folder จากนั้น ไป property ปรากฎว่า Read only ของ Folder ยังคงเป็น read only อยู่ไม่หายไป มันเลยเป็นread only อยู่ เลยได้ ตัวงง อันใหม่มา
ส่วนerror Message ทั้งหมดมีดังนี้ยกมาทั้งหน้าเลยครับ ช่วยหน่อยนะครับ
Server Error in '/Sanya' Application.
--------------------------------------------------------------------------------
Operation must use an updateable query.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.
Source Error:
Line 52: string Update = string.Format("UPDATE [WEBBOARD] SET VIEWED = '{0}' WHERE LastUpdate = '{1}' AND POSTER = '{2}' ",v,time,poster);
Line 53: this.AccessDataSource1.UpdateCommand = Update;
Line 54: this.AccessDataSource1.Update();
Line 55: bool table = true; //set it to true to show that it will answer or view the old topic
Line 56:
Source File: c:\Inetpub\wwwroot\Rose new Design\Webboard.aspx.cs Line: 54
Stack Trace:
[OleDbException (0x80004005): Operation must use an updateable query.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) +1002416
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +255
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +188
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +58
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +161
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +113
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +386
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +325
System.Web.UI.WebControls.SqlDataSource.Update() +20
Webboard.GridView1_SelectedIndexChanged(Object sender, EventArgs e) in c:\Inetpub\wwwroot\Rose new Design\Webboard.aspx.cs:54
System.Web.UI.WebControls.GridView.OnSelectedIndexChanged(EventArgs e) +146
System.Web.UI.WebControls.GridView.HandleSelect(Int32 rowIndex) +90
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +197
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +207
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
|
 |
 |
 |
 |
Date :
2009-07-21 17:23:16 |
By :
padet |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ อย่างที่คุณบอก มันเกี่ยวกับ permission ตอนนี้นอนหลับแล้วครับ
Thank You very much
|
 |
 |
 |
 |
Date :
2009-07-21 19:47:18 |
By :
padet |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำไงได้ล่ะบอกหน่อยเป็นเหมือนกัน
|
 |
 |
 |
 |
Date :
2009-08-23 10:49:32 |
By :
phairainam |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คลิกขวาที่ไฟล์ กำหนด Permission ครับ โดยกำหนด Every one หรือ User อืน ๆ ที่เกี่ยวข้อง แล้วกำหนดแบบ Full Control ครับ
|
 |
 |
 |
 |
Date :
2009-08-23 14:28:31 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
Imports System.Data
Imports System.Data.OleDb
'Imports System.Data.DataRow
Public Class Form1
Private _dataset As DataSet
Private _conn As OleDbConnection
Private _cmd As OleDbCommand
Private _rowCount As Integer = 0
' Private _colCount As Integer = 0
Private _position As Integer = 0
Private Sub btnOK_Click() Handles btnOK.Click
Dim sql As String = "SELECT * FROM User"
_cmd = New OleDbCommand(sql, _conn)
Dim adapter As New OleDbDataAdapter(_cmd) มัน error
_dataset = New DataSet()
Try
[font=Verdana]adapter.Fill(_dataset, "Cust")[/font]
Catch ex As OleDbException
MsgBox(ex.Message)
Exit Sub
End Try
_rowCount = _dataset.Tables("Cust").Rows.Count
For i = 0 To _dataset.Tables("Cust").Rows.Count - 1
If (txtUser.Text <> _dataset.Tables("Cust").Rows(i)("ID_User")) Then
If (txtpassword.Text <> _dataset.Tables("Cust").Rows(i)("ID_User")) Then
MsgBox("เข้าสู่ระบบ")
End If
Else
MsgBox("กรุณากรอก ชื่อ และ passwordใหม่")
End If
Next
_conn.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
_conn = New OleDbConnection(_conStr)
_conn.Open()
txtUser.Text = ""
txtpassword.Text = ""
End Sub
End Class
ช่วยนะคับ
|
 |
 |
 |
 |
Date :
2009-11-11 02:02:54 |
By :
r |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
Imports System.Data
Imports System.Data.OleDb
'Imports System.Data.DataRow
Public Class Form1
Private _dataset As DataSet
Private _conn As OleDbConnection
Private _cmd As OleDbCommand
Private _rowCount As Integer = 0
' Private _colCount As Integer = 0
Private _position As Integer = 0
Private Sub btnOK_Click() Handles btnOK.Click
Dim sql As String = "SELECT * FROM User"
_cmd = New OleDbCommand(sql, _conn)
Dim adapter As New OleDbDataAdapter(_cmd)
_dataset = New DataSet()
Try
adapter.Fill(_dataset, "Cust") เกิด err0r
Catch ex As OleDbException
MsgBox(ex.Message)
Exit Sub
End Try
_rowCount = _dataset.Tables("Cust").Rows.Count
For i = 0 To _dataset.Tables("Cust").Rows.Count - 1
If (txtUser.Text <> _dataset.Tables("Cust").Rows(i)("ID_User")) Then
If (txtpassword.Text <> _dataset.Tables("Cust").Rows(i)("ID_User")) Then
MsgBox("เข้าสู่ระบบ")
End If
Else
MsgBox("กรุณากรอก ชื่อ และ passwordใหม่")
End If
Next
_conn.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
_conn = New OleDbConnection(_conStr)
_conn.Open()
txtUser.Text = ""
txtpassword.Text = ""
End Sub
End Class
=ช่วยหน่อยแก้ไม่ถูกคับ ขอบคุน
|
 |
 |
 |
 |
Date :
2009-11-11 02:05:03 |
By :
Ann |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|