N
Nathan Sokalski
I have an ASP.NET Web Application that writes to an Access database. The
application is able to read from the database with no problem, but it will
not write to it. It is not giving me any errors, but it is also not getting
to the Response.Redirect that comes after the code that saves to the
database. I am not sure what to do next, since I am not recieving any
errors. The connection string in my Web.config is:
<appSettings>
<add key="connectionstring" value="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=C:\webroot\pacentralfcu.com\fpdb\resumes.mdb;"/>
</appSettings>
And the VB.NET code that attempts to write to the Access database is:
Dim myconnection As New
OleDbConnection(System.Configuration.ConfigurationManager.AppSettings("connectionstring"))
Dim cmdsubmit As New OleDbCommand(String.Format("INSERT INTO resumes
(fullname,position,dateuploaded,filename) VALUES('{0}','{1}','{2}','{3}')",
Me.txtName.Text, Me.txtPosition.Text, DateTime.Now().ToShortDateString(),
fn), myconnection)
myconnection.Open()
cmdsubmit.ExecuteNonQuery()
myconnection.Close()
Why is this code not saving to the db? Any help would be appreciated.
Thanks.
application is able to read from the database with no problem, but it will
not write to it. It is not giving me any errors, but it is also not getting
to the Response.Redirect that comes after the code that saves to the
database. I am not sure what to do next, since I am not recieving any
errors. The connection string in my Web.config is:
<appSettings>
<add key="connectionstring" value="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=C:\webroot\pacentralfcu.com\fpdb\resumes.mdb;"/>
</appSettings>
And the VB.NET code that attempts to write to the Access database is:
Dim myconnection As New
OleDbConnection(System.Configuration.ConfigurationManager.AppSettings("connectionstring"))
Dim cmdsubmit As New OleDbCommand(String.Format("INSERT INTO resumes
(fullname,position,dateuploaded,filename) VALUES('{0}','{1}','{2}','{3}')",
Me.txtName.Text, Me.txtPosition.Text, DateTime.Now().ToShortDateString(),
fn), myconnection)
myconnection.Open()
cmdsubmit.ExecuteNonQuery()
myconnection.Close()
Why is this code not saving to the db? Any help would be appreciated.
Thanks.