Jump to content
Xtreme .Net Talk

sg7qb

Members
  • Posts

    5
  • Joined

  • Last visited

sg7qb's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. inserting records into access database hi, how can i do using dataadaptor. i tried to configure it by following the wizard. what do i need to do once i finish configuring that.do i still need to write the code which i wrote earlier in this thread. please tell me the steps to follow.... Thanks
  2. Inserting Data in Access I am getting the following error when i put AcceptChanges after Update() Operation must use an updateable query. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query. Source Error: Line 607: NewDataRow("CheckList2") = "1000" ' CheckBoxList2.SelectedValue Line 608: ds.Tables("ApplicationForm").Rows.Add(NewDataRow) Line 609: OleDbDataAdapter1.Update(ds, "ApplicationForm") Line 610: ds.AcceptChanges() Line 611: Me.OleDbConnection1.Close() Source File: c:\inetpub\wwwroot\WebApplication2\Application.aspx.vb Line: 609 Stack Trace: [OleDbException (0x80004005): Operation must use an updateable query.] System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) WebApplication2.WebForm1.BtnSubmit_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication2\Application.aspx.vb:609 System.Web.UI.WebControls.Button.OnClick(EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain() Please let me know where i am going wrong. Thanks
  3. inserting data into database hi, i am getting the following error when i put acceptchanges() after Update() "Operation must use an updateable query" how can i solve that
  4. sending mail hi, i dont get any error when i implement that code .the message is not mailed to the destination email id. i am running on local smtp server.do i need to make any changes in the smtp server to send mails. please let me know the solution.. thanks
  5. hi, I have few problems with inserting data into access database using asp.net web form. what i am doing is that i am dropping a OleDbConnection and OleDbDataAdaptor to the web form and configuring to connect to the database. I am working on IIS Server on my personal Computer and the database is in the same folder where the asp file is stored . i have written the following code for adding records to the database table.the problem with the below code is that the new record is not getting added to database table. I dont know whether there is any problem with the connection or the code.Can any body help out with this ??? the code is Private Sub BtnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSubmit.Click Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath("Application.mdb") & ";" Me.OleDbSelectCommand1.CommandText = "SELECT * FROM ApplicationForm" Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1 Me.OleDbDataAdapter1.SelectCommand = Me.OleDbSelectCommand1 Dim ds As New DataSet Me.OleDbDataAdapter1.Fill(ds, "ApplicationForm") Dim NewDataRow As DataRow = ds.Tables("ApplicationForm").NewRow NewDataRow("Date1") = TxtDate.Text NewDataRow("FirstName") = TxtFirstName.Text NewDataRow("LastName") = TxtLastName.Text NewDataRow("Address1") = TxtAddress1.Text NewDataRow("Address2") = TxtAddress2.Text NewDataRow("City") = TxtCity.Text NewDataRow("State") = TxtState.Text NewDataRow("ZipCode") = TxtZipCode.Text NewDataRow("Home1") = TxtHome1.Text NewDataRow("Home2") = TxtHome2.Text NewDataRow("Home3") = TxtHome3.Text NewDataRow("Work1") = TxtWork1.Text NewDataRow("Work2") = TxtWork2.Text NewDataRow("Work3") = TxtWork3.Text NewDataRow("Cell1") = TxtCell1.Text NewDataRow("Cell2") = TxtCell2.Text NewDataRow("Cell3") = TxtCell3.Text NewDataRow("Email") = TxtEmail.Text NewDataRow("DriverLicense") = TxtDriver.Text NewDataRow("Student") = RadioButtonList1.SelectedValue() NewDataRow("Smoke") = RadioButtonList6.SelectedValue() NewDataRow("SmokeYes") = TxtYesExplain.Text NewDataRow("Available") = RadioButtonList2.SelectedValue() NewDataRow("Charged") = RadioButtonList3.SelectedValue() NewDataRow("ChargedYes") = TxtOffense.Text NewDataRow("Learn") = TxtPosition.Text NewDataRow("Worked") = RadioButtonList4.SelectedValue() NewDataRow("WorkedYes") = TxtYesWorkedDis.Text NewDataRow("PreferMF") = RadioButtonList5.SelectedValue() NewDataRow("PreferFP") = RadioButtonList7.SelectedValue() NewDataRow("Sunday") = TxtMonday.Text NewDataRow("Tuesday") = TxtTuesday.Text NewDataRow("Wednesday") = TxtWednesday.Text NewDataRow("Thursday") = TxtThursday.Text NewDataRow("Friday") = TxtFriday.Text NewDataRow("Saturday") = TxtSaturday.Text NewDataRow("Comments") = TxtComment.Text NewDataRow("CheckList1") = CheckBoxList1.SelectedValue NewDataRow("CheckList2") = CheckBoxList2.SelectedValue ds.Tables("ApplicationForm").Rows.Add(NewDataRow) ds.AcceptChanges() OleDbDataAdapter1.Update(ds, "ApplicationForm") Me.OleDbConnection1.Close() End Sub
×
×
  • Create New...