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(object sender, System.EventArgs e)
{
@OleDbConnection thisConnection = new OleDbConnection(
@"Provider=Microsoft.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(insertCmd, thisConnection);
myCommand.Parameters.Add(new OleDbParameter("@Id", OleDbType.VarChar,
11));
myCommand.Parameters["@Id"].Value = txtID.Text;
/*Server.HtmlEncode(txtID.Text);*/
myCommand.Parameters.Add(new OleDbParameter("@LName", OleDbType.VarChar,
40));
myCommand.Parameters["@LName"].Value = txtLName.Text; /*
Server.HtmlEncode(txtLName.Text); */
myCommand.Connection.Open();
//myCommand.ExecuteNonQuery();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException xx)
{
// Exception
lblMessage.Text = "Insert Data Failed - " + xx.Message;
}
myCommand.Connection.Close();
}
Thanks 2 2593
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.net> wrote in message
news:OH****************@TK2MSFTNGP09.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(object sender, System.EventArgs e) { @OleDbConnection thisConnection = new OleDbConnection( @"Provider=Microsoft.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(insertCmd, thisConnection); myCommand.Parameters.Add(new OleDbParameter("@Id", OleDbType.VarChar, 11)); myCommand.Parameters["@Id"].Value = txtID.Text; /*Server.HtmlEncode(txtID.Text);*/
myCommand.Parameters.Add(new OleDbParameter("@LName",
OleDbType.VarChar, 40)); myCommand.Parameters["@LName"].Value = txtLName.Text; /* Server.HtmlEncode(txtLName.Text); */ myCommand.Connection.Open();
//myCommand.ExecuteNonQuery(); try { myCommand.ExecuteNonQuery(); } catch (OleDbException xx) { // Exception lblMessage.Text = "Insert Data Failed - " + xx.Message; } myCommand.Connection.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.net> wrote in message
news:OH****************@TK2MSFTNGP09.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(object sender, System.EventArgs e) { @OleDbConnection thisConnection = new OleDbConnection( @"Provider=Microsoft.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(insertCmd, thisConnection); myCommand.Parameters.Add(new OleDbParameter("@Id", OleDbType.VarChar, 11)); myCommand.Parameters["@Id"].Value = txtID.Text; /*Server.HtmlEncode(txtID.Text);*/
myCommand.Parameters.Add(new OleDbParameter("@LName",
OleDbType.VarChar, 40)); myCommand.Parameters["@LName"].Value = txtLName.Text; /* Server.HtmlEncode(txtLName.Text); */ myCommand.Connection.Open();
//myCommand.ExecuteNonQuery(); try { myCommand.ExecuteNonQuery(); } catch (OleDbException xx) { // Exception lblMessage.Text = "Insert Data Failed - " + xx.Message; } myCommand.Connection.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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |