plz plz help

prav_roy

Well-known member
Joined
Sep 10, 2005
Messages
70
Location
Mumbai
Programming Experience
1-3
Operation must use Updateable Query Error

i have the following code which works fine in my PC but the same code when i run it in office it doesn't work, i have to show one demo tommarrow plzzzzzzzzzz help me no..

/*********my code********/

PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim DS AsNew DataSet()
Dim a AsString
a = "hello"
Dim DA As OleDbDataAdapter = New OleDbDataAdapter()
Dim com As OleDbCommand = New OleDbCommand("select * from addi", dbconn)
com.CommandType = CommandType.Text
DA.SelectCommand = com
DA.TableMappings.Add("Tables", "addi")
Try
DS.Clear()
dbconn.Open()
DA.Fill(DS, "addi")
Dim DT As DataTable = DS.Tables("addi")
Dim DR As DataRow = DT.NewRow()
DR("idi") = TextBox1.Text
DR("name") = TextBox2.Text
DR("age") = TextBox3.Text
DT.Rows.Add(DR)
Dim incom As OleDbCommand = New OleDbCommand(" INSERT INTO addi(idi,name,age)values(?,?,?)", dbconn)
incom.Parameters.Add("idi", OleDbType.VarChar, 0, "idi")
incom.Parameters.Add("name", OleDbType.VarChar, 0, "name")
incom.Parameters.Add("age", OleDbType.VarChar, 0, "age")
DA.InsertCommand = incom
DA.Update(DS, "addi")
Finally
dbconn.Close()
EndTry
EndSub

/*******************************/

error i get is
******************

Operation must use an updateable query.
 
Last edited by a moderator:
I once experienced this... the application is unable to write to the database. Check your permission or anything that might block you from actually writing/editing the file. How do you transfer them from your PC to your office? If you burned them in a CD, and copy it to your office PC, they will inherit the 'Read Only' attribute.
 

Latest posts

Back
Top