Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > .NET Framework > Forum > Operation must use an updateable query ได้มาไง งง?


 

[.NET] Operation must use an updateable query ได้มาไง งง?

 
Topic : 029367



โพสกระทู้ ( 4 )
บทความ ( 0 )



สถานะออฟไลน์



ขอรบกวนหน่อยครับ
ผมใช้vs 2008 กำลังหัดเขียนเว็ปแบบฐานข้อมูลแบบMS access ผมเขียนโค้ดให้มันทำงาน แบบ File System แล้วมันก็ทำงานได้ดีแต่พอลองนำมาเปิดใน iis มันก็แจ้งว่า

Operation must use an updateable query งงเลยทำไรไม่ถูก

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();

มันเกิดขึ้นกับ insert into ด้วยครับ รบกวนผู้รู้ช่วยหน่อยครับ



Tag : - - - -

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2009-07-20 22:05:40 By : padet View : 11170 Reply : 9
 

 

No. 1



โพสกระทู้ ( 483 )
บทความ ( 0 )



สถานะออฟไลน์


มันน่าจะมี Error บอกมากกว่านี้นะครับ ช่วยเอามาให้หมดเลยครับ
Date : 2009-07-21 13:22:08 By : taobsd
 

 

No. 2



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Database น่าจะ ReadOnly หรือไม่มีสิทธิ์ในการแก้ไข/เพิ่ม ข้อมูลครับ
Date : 2009-07-21 13:23:24 By : webmaster
 

 

No. 3



โพสกระทู้ ( 4 )
บทความ ( 0 )



สถานะออฟไลน์


ผมอยากลองแก้ที่ ไฟล์เป็น 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
 

 

No. 4



โพสกระทู้ ( 4 )
บทความ ( 0 )



สถานะออฟไลน์


ได้แล้วครับ อย่างที่คุณบอก มันเกี่ยวกับ permission ตอนนี้นอนหลับแล้วครับ
Thank You very much
Date : 2009-07-21 19:47:18 By : padet
 

 

No. 5



โพสกระทู้ ( 9 )
บทความ ( 1 )



สถานะออฟไลน์


ทำไงได้ล่ะบอกหน่อยเป็นเหมือนกัน
Date : 2009-08-23 10:49:32 By : phairainam
 

 

No. 6



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

คลิกขวาที่ไฟล์ กำหนด Permission ครับ โดยกำหนด Every one หรือ User อืน ๆ ที่เกี่ยวข้อง แล้วกำหนดแบบ Full Control ครับ
Date : 2009-08-23 14:28:31 By : webmaster
 

 

No. 7

Guest


Code (VB.NET)
01.Imports System.Data
02.Imports System.Data.OleDb
03.'Imports System.Data.DataRow
04. 
05.Public Class Form1
06.    Private _dataset As DataSet
07.    Private _conn As OleDbConnection
08.    Private _cmd As OleDbCommand
09.    Private _rowCount As Integer = 0
10.    ' Private _colCount As Integer = 0
11.    Private _position As Integer = 0
12. 
13.    Private Sub btnOK_Click() Handles btnOK.Click
14. 
15.        Dim sql As String = "SELECT * FROM User"
16.        _cmd = New OleDbCommand(sql, _conn)
17.        Dim adapter As New OleDbDataAdapter(_cmd)  มัน error
18.        _dataset = New DataSet()
19.        Try
20.            [font=Verdana]adapter.Fill(_dataset, "Cust")[/font]
21.        Catch ex As OleDbException
22.            MsgBox(ex.Message)
23.            Exit Sub
24.        End Try
25.        _rowCount = _dataset.Tables("Cust").Rows.Count
26.        For i = 0 To _dataset.Tables("Cust").Rows.Count - 1
27.            If (txtUser.Text <> _dataset.Tables("Cust").Rows(i)("ID_User")) Then
28.                If (txtpassword.Text <> _dataset.Tables("Cust").Rows(i)("ID_User")) Then
29.                    MsgBox("เข้าสู่ระบบ")
30. 
31.                End If
32.            Else
33.                MsgBox("กรุณากรอก ชื่อ และ passwordใหม่")
34.            End If
35.        Next
36.        _conn.Close()
37. 
38.    End Sub
39.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
40.        _conn = New OleDbConnection(_conStr)
41.        _conn.Open()
42.        txtUser.Text = ""
43.        txtpassword.Text = ""
44. 
45.    End Sub
46.End Class


ช่วยนะคับ
Date : 2009-11-11 02:02:54 By : r
 

 

No. 8

Guest


Code (VB.NET)
01.Imports System.Data
02.Imports System.Data.OleDb
03.'Imports System.Data.DataRow
04. 
05.Public Class Form1
06.    Private _dataset As DataSet
07.    Private _conn As OleDbConnection
08.    Private _cmd As OleDbCommand
09.    Private _rowCount As Integer = 0
10.    ' Private _colCount As Integer = 0
11.    Private _position As Integer = 0
12. 
13.    Private Sub btnOK_Click() Handles btnOK.Click
14. 
15.        Dim sql As String = "SELECT * FROM User"
16.        _cmd = New OleDbCommand(sql, _conn)
17.        Dim adapter As New OleDbDataAdapter(_cmd)
18.        _dataset = New DataSet()
19.        Try
20.            adapter.Fill(_dataset, "Cust")   เกิด err0r
21.        Catch ex As OleDbException
22.            MsgBox(ex.Message)
23.            Exit Sub
24.        End Try
25.        _rowCount = _dataset.Tables("Cust").Rows.Count
26.        For i = 0 To _dataset.Tables("Cust").Rows.Count - 1
27.            If (txtUser.Text <> _dataset.Tables("Cust").Rows(i)("ID_User")) Then
28.                If (txtpassword.Text <> _dataset.Tables("Cust").Rows(i)("ID_User")) Then
29.                    MsgBox("เข้าสู่ระบบ")
30. 
31.                End If
32.            Else
33.                MsgBox("กรุณากรอก ชื่อ และ passwordใหม่")
34.            End If
35.        Next
36.        _conn.Close()
37. 
38.    End Sub
39.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
40.        _conn = New OleDbConnection(_conStr)
41.        _conn.Open()
42.        txtUser.Text = ""
43.        txtpassword.Text = ""
44. 
45.    End Sub
46.End Class


=ช่วยหน่อยแก้ไม่ถูกคับ ขอบคุน
Date : 2009-11-11 02:05:03 By : Ann
 

 

No. 9

Guest


Go to : Operation must use an updateable query ได้มาไง งง?
Date : 2011-08-13 10:00:47 By : thaicreate
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : Operation must use an updateable query ได้มาไง งง?
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่