Hi,
I have following problem:
Operation must use an updateable query
I have use OleDb, C# and ASP.NET and MS Access DB named pubs.
Code:
private void Button1_Click(o bject sender, System.EventArg s e)
{
@OleDbConnectio n thisConnection = new OleDbConnection (
@"Provider=Micr osoft.Jet.OLEDB .4.0;" +
@"Data Source=" +
@"C:\base\pubs. mdb");
String insertCmd = "insert into Authors (au_id, au_lname) values (@Id,
@LName)";
OleDbCommand myCommand = new OleDbCommand(in sertCmd, thisConnection) ;
myCommand.Param eters.Add(new OleDbParameter( "@Id", OleDbType.VarCh ar,
11));
myCommand.Param eters["@Id"].Value = txtID.Text;
/*Server.HtmlEnc ode(txtID.Text) ;*/
myCommand.Param eters.Add(new OleDbParameter( "@LName", OleDbType.VarCh ar,
40));
myCommand.Param eters["@LName"].Value = txtLName.Text; /*
Server.HtmlEnco de(txtLName.Tex t); */
myCommand.Conne ction.Open();
//myCommand.Execu teNonQuery();
try
{
myCommand.Execu teNonQuery();
}
catch (OleDbException xx)
{
// Exception
lblMessage.Text = "Insert Data Failed - " + xx.Message;
}
myCommand.Conne ction.Close();
}
Thanks 2 2629
Hi,
I have put this example on web and everything works but localy doesn't.
Do you have ideas why does not work locally?
Thanks,
Mirko
"mp" <pl****@volja.n et> wrote in message
news:OH******** ********@TK2MSF TNGP09.phx.gbl. .. Hi,
I have following problem:
Operation must use an updateable query
I have use OleDb, C# and ASP.NET and MS Access DB named pubs.
Code:
private void Button1_Click(o bject sender, System.EventArg s e) { @OleDbConnectio n thisConnection = new OleDbConnection ( @"Provider=Micr osoft.Jet.OLEDB .4.0;" + @"Data Source=" + @"C:\base\pubs. mdb");
String insertCmd = "insert into Authors (au_id, au_lname) values (@Id, @LName)";
OleDbCommand myCommand = new OleDbCommand(in sertCmd, thisConnection) ; myCommand.Param eters.Add(new OleDbParameter( "@Id", OleDbType.VarCh ar, 11)); myCommand.Param eters["@Id"].Value = txtID.Text; /*Server.HtmlEnc ode(txtID.Text) ;*/
myCommand.Param eters.Add(new OleDbParameter( "@LName",
OleDbType.VarCh ar, 40)); myCommand.Param eters["@LName"].Value = txtLName.Text; /* Server.HtmlEnco de(txtLName.Tex t); */ myCommand.Conne ction.Open();
//myCommand.Execu teNonQuery(); try { myCommand.Execu teNonQuery(); } catch (OleDbException xx) { // Exception lblMessage.Text = "Insert Data Failed - " + xx.Message; } myCommand.Conne ction.Close(); }
Thanks
Hi,
I have put this example on web and everything works but localy doesn't.
Do you have ideas why does not work locally?
Thanks,
Mirko
"mp" <pl****@volja.n et> wrote in message
news:OH******** ********@TK2MSF TNGP09.phx.gbl. .. Hi,
I have following problem:
Operation must use an updateable query
I have use OleDb, C# and ASP.NET and MS Access DB named pubs.
Code:
private void Button1_Click(o bject sender, System.EventArg s e) { @OleDbConnectio n thisConnection = new OleDbConnection ( @"Provider=Micr osoft.Jet.OLEDB .4.0;" + @"Data Source=" + @"C:\base\pubs. mdb");
String insertCmd = "insert into Authors (au_id, au_lname) values (@Id, @LName)";
OleDbCommand myCommand = new OleDbCommand(in sertCmd, thisConnection) ; myCommand.Param eters.Add(new OleDbParameter( "@Id", OleDbType.VarCh ar, 11)); myCommand.Param eters["@Id"].Value = txtID.Text; /*Server.HtmlEnc ode(txtID.Text) ;*/
myCommand.Param eters.Add(new OleDbParameter( "@LName",
OleDbType.VarCh ar, 40)); myCommand.Param eters["@LName"].Value = txtLName.Text; /* Server.HtmlEnco de(txtLName.Tex t); */ myCommand.Conne ction.Open();
//myCommand.Execu teNonQuery(); try { myCommand.Execu teNonQuery(); } catch (OleDbException xx) { // Exception lblMessage.Text = "Insert Data Failed - " + xx.Message; } myCommand.Conne ction.Close(); }
Thanks
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ano1optimist |
last post by:
I have been running these queries in Access 2000 with no problems.
This week, I had to install Access 2003 to create some runtime
versions for another application, and now I keep getting "operation
must be an updateable query" messages when I try to run the same old
queries. Here is a sample of one that is no longer working:
UPDATE Personnel INNER JOIN dbo_personnel ON .=
dbo_personnel. SET personnel. = dbo_personnel.,...
|
by: mp |
last post by:
Hi,
I have following problem:
Operation must use an updateable query
I have use OleDb, C# and ASP.NET and MS Access DB named pubs.
Code:
|
by: mp |
last post by:
Hi,
I have following problem:
Operation must use an updateable query
I have use OleDb, C# and ASP.NET and MS Access DB named pubs.
Code:
|
by: Arpan |
last post by:
I have always been working with SQL Server 2005 for ASP.NET apps but
due to some reasons, had to revert back to MS-Access 2000.
When I try to insert/update a MS-Access DB table (MDB), ASP.NET
generates the following error:
Operation must use an updateable query.
pointing to a line that says
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |