Hi!
I have a strange predicament with a vb.net module that i am attempting to use. I can perform 'select' query operations on my db, mainDB. A table tblGetsUpdated has certain records that need to be updated on runtime from a form of a windows app. Any other query with an 'update' or 'insert' do not seem to work at all. Any thing I might missing out on? Tried looking all over the place to see for solutions but there isn't a similar case anyplace.
My specs are as follows.
- VS 2008
- MS SQL Express 2008
- Attempting Windows Application
Here is a sample that doesn't change the db contents.
mycon.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\mainDB.mdf;Integrated Security=True;User Instance=True" mycon.Open() Dim sqlquery As String sqlquery = "Update tbllogin set locked=0 where U_Id='" & UID & "'" Dim myCommand As New SqlClient.SqlCommand(sqlquery, mycon) icount = myCommand.ExecuteNonQuery |
Daniel VarghesePosted Jun 24, 2010, 3:02 PM
The problem it seems lies in the mdf file. Right-Click the file, select properties, see whether the read only option is selected. If yes uncheck it and run your code again against the .mdf file. Your code should run just fine.
Thanks,
Daniel
Please do not forget to mark the post as Answer if it has solved your problem