Hello All,
I am having a problem inserting data into an Access Database. Im using Visual Studio Developer with an AccessDataSource object to connect to the database and a Gridview object to access the database information and displaying. There is no problem when displaying the information, the Gridview object is populated from the database and shows all correct information. The problem im having is when trying to manipulate the information in the database in any way. One example is when I set up the AccessDataSource control I select all the fields and click Advanced with brings me to the screen where i enable the check box for Generate Insert, Update, and Delete queries. This gives me the option on my Gridview to add the Edit, Delete, or Update the information that is being populated by the Gridview. When I actually try to edit any of the information im getting a Runtime error, this occurs with Update, Select, Edit anything that actually modifys the data in the database. I have also tried elimating the gridvew object and just running an Insert Query from the AccessDataSource. Just a basic Insert Query shown below :
INSERT INTO [Inclearing] ( [InclearingProcessed], [InclearingSpreadsheet]) VALUES ( InclearingProcessed, InclearingSpreadsheet)
The is run from the AccessDataSource.Insert propery. I call the property by a Commandbutton with code AccessDataSource.Insert()
Which have defined Perameters to Textboxes.
Now when i use this on my Local Computer Everything works fine and it addes the information to the database in the appropriate spots. However, once i transfer my site to the Web host i get the runtime error when trying to modify the information. However, the Gridview object still populates when it is on the webserver so I know the AccessDatasource is still getting a connection.
Putting everything aside, If my gridview object is being populated by the information in the Database on the Webserver, when modifying the information directly from the gridview that I know has a Database Connection I should be able to manipulate the data. This is when i get the Runtime error.
Any Suggestions besides telling me to use straight ADO code. There is no reason that I can see why this wouldnt work.
Is it a possiblity that when the the website is initially opened the Gridview Calls the information from the Access DB and populates the Gridview then terminates the connection to the DB, which wouldnt allow me to manipulate the data or does it keep the connection?
Help!
Thanks,