|
-
March 31st, 2003, 01:33 AM
#1
INSERT INTO Query
Hi
I am using the query:
INSERT INTO Brands ([BName],[BDescription],[PicturePath]) VALUES ('mm','mm','mm')
by using the "ExecuteNonQuery" of "OleDbCommand".
and i am getting the error:
"Operation must use an updateable query. "
I tried to execute the same query directly from the
mdb file and it's working.
any ideas?
Thanks
Limor
-
April 3rd, 2003, 04:02 AM
#2
Hi
Please check the constraints once again and check the autonumber column(Primary Key) working properly!!
thanks
Murali
-
April 4th, 2003, 02:25 PM
#3
I don't think you can use ExecuteNonQuery when executing queries like that (hence the name ExecuteNONQuery). I think it's for executing stored procedures. Use ExecuteScalar instead.
Hope this helps.
Do what thou wilt, shall be the whole of the law.
-
April 5th, 2003, 03:56 AM
#4
ExecuteScalar will return only firstcolumn of the firstrow in the resultset. ExecuteNonQuery returns the count of records affected.
ExecuteNonQuery is the correct one in this case but I think there is something wrong in the database side or at the code part. Paste the Insert code part over here.
-
April 6th, 2003, 06:38 AM
#5
INSERT INTO Brands ([BName],[BDescription],[PicturePath]) " & _
"VALUES ('nameStr','decStr','pathStr')
i took this query and run it from the access file and it's working.
it gives me the same error when i use the UPDATE query
i am using this syntax all the time.
this is the first time i get this error
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|