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
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
คลิกขวาที่ไฟล์ กำหนด Permission ครับ โดยกำหนด Every one หรือ User อืน ๆ ที่เกี่ยวข้อง แล้วกำหนดแบบ Full Control ครับ
Date :
2009-08-23 14:28:31
By :
webmaster
No. 7
Guest
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
No. 8
Guest
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