OleDb May Cause A Problem?

Discussion in 'ASP .Net Web Services' started by Arif Çimen, Apr 19, 2005.

  1. Arif Çimen

    Arif Çimen Guest

    Hi all folks,

    I wrote simple code like that:

    try

    {

    //oleDbConnection1.="Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry
    Path=;Jet OLEDB:Database Locking Mode=1;Data Source=".\Project Request
    Database\ProjectRequestDB.mdb";Mode=Share Deny None;Jet OLEDB:Engine
    Type=5;Provider="Microsoft.Jet.OLEDB.4.0";Jet OLEDB:System database=;Jet
    OLEDB:SFP=False;persist security info=False;Extended Properties=;Jet
    OLEDB:Compact Without Replica Repair=False;Jet OLEDB:Encrypt
    Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy
    Locale on Compact=False;User ID=Admin;Jet OLEDB:Global Bulk
    Transactions=1";//../Project Request Database/ProjectRequestDB.mdb";

    //oleDbConnection1.DataSource="../Project Request
    Database/ProjectRequestDB.mdb";

    string currDir=Server.MapPath("");

    //string =Directory.GetCurrentDirectory();

    currDir=currDir+"\\Project Request Database\\ProjectRequestDB.mdb";

    oleDbConnection1.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data
    Source="+currDir;

    oleDbConnection1.Open();

    oleDbCommand1.Parameters["Name"].Value=TextBox3.Text;

    oleDbCommand1.Parameters["Surname"].Value=TextBox2.Text;

    oleDbCommand1.Parameters["Project_Title"].Value=TextBox4.Text;

    oleDbCommand1.Parameters["Project_Details"].Value=TextBox5.Text;

    oleDbCommand1.Parameters["e_mail"].Value=TextBox6.Text;

    //oleDbCommand1.Parameters[""].Value=TextBox3.Text;

    oleDbCommand1.ExecuteNonQuery();

    }

    finally

    {

    oleDbConnection1.Close();

    }



    And the server error comes:



    What may be the reason?

    Thanks for any help.

    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



    Server Error in '/test' Application.
    --------------------------------------------------------------------------------

    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:

    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.

    Stack Trace:

    [OleDbException (0x80004005): Operation must use an updateable query.]
    System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
    +41
    System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
    dbParams, Object& executeResult) +174
    System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
    +92
    System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
    Object& executeResult) +65
    System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
    behavior, String method) +112
    System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +67
    Test.WebForm1.Button1_Click(Object sender, EventArgs e) in
    e:\websayfamiz1\test\webform1.aspx.cs:97
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +57
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain() +1292





    --------------------------------------------------------------------------------

    Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
    Version:1.1.4322.2032
    Arif Çimen, Apr 19, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Angelo Brusati
    Replies:
    3
    Views:
    1,425
    Angelo Brusati
    Mar 31, 2005
  2. Rob Dob
    Replies:
    4
    Views:
    6,189
    Rob Dob
    Mar 30, 2006
  3. eric
    Replies:
    2
    Views:
    827
  4. Stu
    Replies:
    11
    Views:
    773
    Mark Hubbart
    Nov 13, 2004
  5. Trans
    Replies:
    3
    Views:
    146
Loading...

Share This Page