vb.net oracle update


I'm trying to attempt my first oracle update in code. This is an update off of a gridview.

Below is my code. When I run I get this error: ORA-00911: invalid character.
I checked the values of strPassW, txtSecurity and txtUserId and they are all valid.

Can you tell me what is wrong? Thanks  

Dim trans As OracleTransaction = NewOracleConnection.BeginTransaction(IsolationLevel.ReadCommitted)
Dim cmd As New OracleCommand("Update ZSIGNON set UserPassWord=?, SecurityLevel=? " & _
                   "Where UserId=?", NewOracleConnection)

cmd.Parameters.Add(New OracleParameter("UserPassWord", strPassW))      
cmd.Parameters.Add(New OracleParameter("SecurityLevel", txtSecurity))
cmd.Parameters.Add(New OracleParameter("UserId", txtRecid))

cmd.ExecuteNonQuery()                ' I get the error on this line. 
4/14/2009 4:14:52 PM
asp.net.oracle 2269 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 43


invalid character

identifiers may not start with any ASCII character other than letters and numbers. $#_ are also allowed after the first character. Identifiers enclosed by doublequotes may contain any character other than a doublequote. Alternative quotes (q'#...#') cannot use spaces, tabs, or carriage returns as delimiters. For all other contexts, consult the SQL Language Reference Manual.

you might be having some semicolon(;) some kinda invalid string with variables you are passing just checkout that. you might be using these in password filed, if it is so change that field to correct datatype which accepts special chars.


4/14/2009 5:41:59 PM

Not really knowing how to use parameters with the oracle update. I did get the update working by removing the parameter parts and using this instead:

Dim cmd As New OracleCommand("Update ZSIGNON set UserPassWord='" & strPassW & "', SecurityLevel='" & txtSecurity & "' Where UserId='" & txtRecid & "'", NewOracleConnection)

Perhaps the invalid character was the =? as I would if it were a oldeb command. Perhaps Oracle uses something else.  


4/14/2009 6:47:23 PM

Not sure if this will help but try:

 Update ZSIGNON set UserPassWord=:UserPassword, SecurityLevel=:SecurityLevel Where UserId=:UserId

Then set the parameters as

cmd.Parameters.Add(New OracleParameter(":UserPassWord", strPassW))     
cmd.Parameters.Add(New OracleParameter(":SecurityLevel", txtSecurity))
cmd.Parameters.Add(New OracleParameter(":UserId", txtRecid))

or even
Dim paramUserId as New OracleParameter(":UserPassword", OracleDbType.Varchar2)
paramUserId.Value = strPassW

Also, be careful not to use any oracle reserved words for parameter names: http://www.uwex.edu/infosys/oraprod/reserved/

This is how I assign oracle parameters when using the oracle data access client.

Good luck

4/15/2009 1:52:27 AM

Similar Artilces:

urgent: .NET Provider for Oracle or Oracle Data Provider for .NET
If I want to access Oracle DB in ASP.NET application, and I am using .NET Provider for Oracle or Oracle Data Provider for .NET, should I have to install OracleClient on my .NET server? Is there other choice? Thank you very much.Johnson Johnson2007:should I have to install OracleClient on my .NET server?  You have to options1. install the ODP.NET on your web serverOR2. put the oracle assemblies in your BIN directory   Hi jimmy,Thank you for you reply. Because I could not find a server right now, I should test it first before I agree or disagree with you, as most articles I...

vb.net function and Oracle procedure to get an Oracle Dataset??
I have similar code (a procedure and function) working perfectly with a sql server data source. I;'m trying to do the same things with Oracle, but have run into the problems.    I'm not an oracle expert, so I'm not sure if producing a cursor is my only and best  option. create or replace package body PK_RETAILER isPROCEDURE sp_Get_Order_History(v_ani IN number,output_cursor out PK_CURSORES.generic_cursor) ASBEGINopen output_cursor forselect o.account_number, p.phone, o.amount, o.name, o.init_datefrom orders ojoin users_phones p on p.account_number...

Return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle
Hello, I am wondering if anyone in this community knows the shorter way to return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle, something likereturn (IDataReader) SqlHelper.ExecuteReader(ConnectionString, "GET_ACCOUNT", Id); instead of using the way below (look at the C# code) Stored Procedure create or replace PROCEDURE "GET_ACCOUNT" ( p_ID IN ACCOUNT.ID%type, retCursor OUT SA.MYGEN.sqlcur ) IS BEGIN OPEN retCursor FOR SELECT ID, NAME FROM ACCOUNT WHERE ID = p_ID ; ...

which is shou i use? Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NET
Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NETI am confused?Which is better or which one should I use?BTW, I am going to use .net 2.0 with oracle 9. Can anyone tell me what shou I use for working with oracle database?Thanks very much in advance!Justin Oracle's data provider has more functionality than Microsoft's.If your doing transaction processing you can have SAVEPOINTs, which Microsoft's data provider does not provide.Also, Oracle has PL/SQL Associative Arrays which are very powerful.Oracle also allows you to bind parameters by name and pos...

Problem with Oracle Stored Procedures using ODP.NET in VB.NET (VS 2003)
This is the stored procedure,Procedure RetrieveReservations(pProperty In Varchar2,pResHeaderId In Varchar2,pEmail In Varchar2,pPasswd In Varchar2,ResultSet In Out ResCursor);This is the old .asp code (part of it)objConn.ConnectionString = Application("BackEndConnection_ConnectionString")objConn.Open objComm.ActiveConnection = objConn objComm.CommandText = "internet_package.RetrieveReservations"objComm.CommandType = adCmdStoredProc objComm.Parameters.Append objComm.CreateParameter("pProperty", adVarChar , adParamInput, 8, Request.QueryString("propid"))objComm.Parameters.Append objComm.Crea...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Help me pls. i wan't code for startup and shutdown oracle database with vb.net or c#.net
Help me pls. i wan't code for startup and shutdown oracle database with vb.net or c#.net In Windows, it would be easier to interact with Oracle by way of the service...  (I've not tried it myself, but this should work fine for a service installed on the same machine as the .net application:using System.ServiceProcess; ServiceController controller = new ServiceController(); controller.MachineName = "."; controller.ServiceName = "OracleServiceORCL"; string status = controller.Status.ToString(); // Stop the service controller.Stop(); // Start the ...

.NET Oracle Provider
Hi all,I am using .NET 2.0 Frameworks Oracle provider and it does not have a OracleDbTypes Type for me to use. I would like to create a parameter that is of the Oracle type NVARCHAR, but it seems I can only use DbTypes, which does not have this. If I used DbTypes.String, would this be ok, otherwise, how else can I be more specific about the Oracle Parameter data type?Thanks  can u explain which type of data u r going to storeThank uBaba Thank uBabaPlease remember to click "Mark as Answer" on this post if it helped you. What's your version of ODP? You have OracleD...

Which .Net Provider for Oracle 9i Microsoft or Oracle
Can anyone provide me pros and cons of provider to access Oracle Database ? I am aware of Microsoft Provider and Oracle Provider. Microsoft http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/manprooracperf.asp Oracle http://otn.oracle.com/software/tech/windows/odpnet/utilsoft.html I guess you can use either. But as some post suggests, if both installed, then MS ODP will not work. I've been using DataDirect Technologies Connect for .Net and Oracle. It's not free, so it depends on your budget. The speed improvements were great for us, and it's ni...

Oracle ODP.net mulitple Oracle Client
To connect to the oracle database using ODP.net, the applicate must add the dll file called Oracle.DataAccess. There are a lot of version of Oracle.DataAccess. As I know, if the client use Oracle Client 10g Release 2. If the client use Oracle Client 10g Release 2, the application also have to use the Oracle.DataAccess the come from Oracle Client 10g Release 2.  My question is that there are any method to add more than one Oracle.DataAccess version in my product to support multiple OracleClient.   That should automatically happen for the most part.  Oracle's ODP.NET i...

converting to vb.net from c#.net authorize.net
authorize.net offered me some sample code when I signed up with them the only problem is the sample code is in c#.net but my page that they type all of their credit card into is vb.net <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage("https://certification.authorize.net/gateway/transact.dll"); } private String readHtmlPage(string url) { ...

OleDb.Net vs. ODBC.Net Connection to Oracle
I want to connect to an Oracle database, and I understand that I can use either the OleDB.Net data provider or the ODBC.Net data provider for my connection. Does it matter which one I use? What are the advantages and disadvantages of each? Would appreciate any input. ODBC is slower than OleDb. because ODBC has to talk to OleDbProvider then OleDbProvider will talk to Oracle Db. Instead if you are able to use OleDb straight to DB then it will be faster. If you only have THOSE choices, I would take OleDb over ODBC any day. If you are using Framework 1.1, you have the choice of using th...

VB.NET to oracle database connection
Hello,  I've been trying for days to try to connect to oracle database but still no success, I've put the connection in the web.config in the <ConnectionString> place, created the connection on the page itself: Private sqlCon As New OleDbConnection("Provider=msdaora;Data Source=Server1/orcl2;User Id=Train;Password=Train;") but still no success, Now I'm trying to make a local connection throught Tools > Connect to database but still no success. All I get is this: System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name at Could ...

VB.NET and Oracle database, help
i am trying to connect to a Oracle database using VB.NET. that database has one table which has one entry in it. no compilation errors, no runtime errors... but no result either.i've downloaded the system.data.oracleclient.dll as u can see i referenced it in the code, i've opened a connection manually(not with the code) with the oracle database.here's the code: <%@ Page Language="vb" Explicit="true" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1" CompilerOptions='/R:"C:\Pr...

Web resources about - vb.net oracle update - asp.net.oracle

Oracle - Wikipedia, the free encyclopedia
This article is about the classical medium. For the software company, see Oracle Corporation . For other uses, see Oracle (disambiguation) . ...

Oracle - Wikipedia, the free encyclopedia
This article is about the classical medium. For the software company, see Oracle Corporation . For other uses, see Oracle (disambiguation) . ...

News Oracle
The News Oracle is an online news outlet. The Oracle covers the most relevant stories from around the globe.

Kenshoo, Oracle Social Cloud Announce Integration
... and provider of cloud-based digital marketing solutions and predictive media optimization technology, announced an integration with Oracle Social ...

Oracle Sees Future in Traditional Targeting
The evangelists of cutting-edge audience data and targeting are embracing the traditional. Oracle, owner of digital data pioneers BlueKai and ...

Oracle: Cloud Profit Set to Trough This Year, Rise in ’17, Says Goldman
Shares of database giant Oracle (ORCL) are up 54 cents, 1.5%, $37.84, after Goldman Sachs’s Heather Bellini this morning reiterated her Buy rating ...

Oracle's Amazon-killer might really be six months away
At Oracle's enormous customer conference held last month in San Francisco, company execs talked endlessly about Oracle's plan to dominate in ...

Tencent Holding ADR Partners With Oracle To Expand Cloud Services In China
China Business News Tencent Holding ADR Partners With Oracle To Expand Cloud Services In China China Business News Oracle Corporation (NYSE:ORCL) ...

Court tosses out Oracle's bid to disqualify Java expert
A court in California has declined Oracle's bid to disqualify an expert in its copyright dispute with Google over the use of Java code in the ...

How did Rush feel when Oracle roared for his huge third quarter?
... Search 54° Navigation Home Giants A's Sharks Warriors Kings 49ers Raiders Quakes Insiders More Tickets Shop Watch How did Rush feel when Oracle ...

Resources last updated: 12/4/2015 2:44:49 AM