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 2592
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: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: 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...
| |