hockeylvr
Technical User
- Nov 26, 2002
- 140
I have created an asp.net form page which inserts the inputted data into an Access db. I have some form fields that are not required, but, when left blank, I am getting an error message stating that the values are missing.
I have them set up in my Access table as not required. Has anyone else had/resolved this issue? The non-required field I am currently working on is @red,"txtRed"
Sub SubmitProject(ByVal s As Object, ByVal e As EventArgs)
objCmd = New Data.OleDb.OleDbCommand("INSERT INTO tblTemp (owner, manager, projtype, pf, status, <b>@red</b>, @volume,@cutin)", objConn)
objCmd.Parameters.AddWithValue("@owner", ddlOwner.SelectedItem.Value)
objCmd.Parameters.AddWithValue("@manager", ddlMgr.SelectedItem.Value)
objCmd.Parameters.AddWithValue("@projtype", ddlProjType.SelectedItem.Value)
objCmd.Parameters.AddWithValue("@pf", ddlPF.SelectedItem.Value)
objCmd.Parameters.AddWithValue("@status", ddlStatus.SelectedItem.Value)
<b> objCmd.Parameters.AddWithValue("@red", txtRed.Text)</b>
objCmd.Parameters.AddWithValue("@volume", txtVol.Text)
objCmd.Parameters.AddWithValue("@cutin", Convert.ToDateTime(txtCutIn.Text))
objConn.Close()
objConn.Open()
objCmd.ExecuteNonQuery()
objConn.Close()
Response.Redirect("Default2.aspx")
Thanks for any help - also, I seem to be coming across what I'm sure are very simple questions like these. Could anyone recommend a very "beginners" book on asp.net? I currently have a Sitepoint and a Microsoft book but they don't address some of what I think are the basics like this.
Toni
I have them set up in my Access table as not required. Has anyone else had/resolved this issue? The non-required field I am currently working on is @red,"txtRed"
Sub SubmitProject(ByVal s As Object, ByVal e As EventArgs)
objCmd = New Data.OleDb.OleDbCommand("INSERT INTO tblTemp (owner, manager, projtype, pf, status, <b>@red</b>, @volume,@cutin)", objConn)
objCmd.Parameters.AddWithValue("@owner", ddlOwner.SelectedItem.Value)
objCmd.Parameters.AddWithValue("@manager", ddlMgr.SelectedItem.Value)
objCmd.Parameters.AddWithValue("@projtype", ddlProjType.SelectedItem.Value)
objCmd.Parameters.AddWithValue("@pf", ddlPF.SelectedItem.Value)
objCmd.Parameters.AddWithValue("@status", ddlStatus.SelectedItem.Value)
<b> objCmd.Parameters.AddWithValue("@red", txtRed.Text)</b>
objCmd.Parameters.AddWithValue("@volume", txtVol.Text)
objCmd.Parameters.AddWithValue("@cutin", Convert.ToDateTime(txtCutIn.Text))
objConn.Close()
objConn.Open()
objCmd.ExecuteNonQuery()
objConn.Close()
Response.Redirect("Default2.aspx")
Thanks for any help - also, I seem to be coming across what I'm sure are very simple questions like these. Could anyone recommend a very "beginners" book on asp.net? I currently have a Sitepoint and a Microsoft book but they don't address some of what I think are the basics like this.
Toni