Working with access and typed data set

  • Thread starter Thread starter Kursat
  • Start date Start date
K

Kursat

Hi,

I have experienced a strange erro while using with Access 2007. Here is the
problem :

I have a simple table with a AutoIncrement field as primary key and two text
fields.

I generate typed dataset at visual studio by using datasource wizard. It
asked me to include the access file into the project and I said yes. when I
look the project's folder I see the access file copied to the project's
folder and debug folder.

I created an insert query by using visual datasource editor and name the
function as "create (string, string)". It takes two string parameters mapped
to two text field on the table.

I wrote the code that inserts some rows to the table like this :

UsersTableAdapter adp = new UsersTableAdapter();

usersadp.create (txtUserName.Text, txtPassword.Text);

After tihs when I check the access file in the project folder I can't see
any row inserted but the file in the debug folder contains inserted rows.
OK, nevermind but after some arbitrary period I activate the access and see
a messagebox saying invalid bookmark. After this all inserted rows
disappeared permanently.

I cannot figure out the problem, please help me if you have an idea.

Thanks in advance.
 
By default, database files (JET or SQL Server) that are included in the
project are overlaid in the Debug (and Production) folders on each execution
until you deploy the application. This means changes made during a test run
are overlaid the next time the application is debugged. Select the file and
change the "Copy to Output Directory" property to "Never" or (in Texas)
"When Oklahoma wins the Cotton Bowl".

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________
 
Back
Top