Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 28th, 2008, 12:50 AM
Authorized User
 
Join Date: Nov 2007
Location: patna, bihar, India.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sanjeev jha
Default ERROR [42000] [Microsoft][ODBC driver for Oracle][

using vb
my problems in insertion the code part display data is working but insetion part reported error
ERROR [42000] [Microsoft][ODBC driver for Oracle][Oracle]ORA-00936: missing expression
my code is
Code:
<%@ import Namespace="System.Data.ODbc" %>
<%@ Import Namespace=" System.Data"%>
<script runat="server">

Sub submit(sender As Object, e As EventArgs)
dim dbconn,sql,dbcomm,dbread
dbconn=New ODbcConnection("dsn=oracle;uid=starter;pwd=starter;")
dbconn.Open()
sql="SELECT * FROM students"
dbcomm=New ODbcCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
customers.DataSource=dbread
customers.DataBind()
dbread.Close()
dim isql,idbread,idbcomm
isql="Insert Into students(id,first_name,last_name,major) values (@fname,@id,@lname,@major)"
idbcomm=new odbccommand(isql,dbconn)
idbcomm.Parameters.Add( "@fname",fname.text)
idbcomm.Parameters.Add( "@id",id.Text)
idbcomm.Parameters.Add( "@lname",lname.Text)
idbcomm.Parameters.Add( "@major",major.Text)
idbcomm.ExecuteNonQuery()

dbconn.Close() 
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<th>
Id Number:</th>
<asp:TextBox id="id" runat="server"></asp:TextBox>
<br />
<br />
<th>MaJor:</th>
<asp:TextBox id="major" runat="server"></asp:TextBox>
<br />
<br />
<th>First Name:</th>
<asp:TextBox id="fname" runat="server"></asp:TextBox>
<br />
<br />
<th>Last Name:</th>
<asp:TextBox id="lname" runat="server"></asp:TextBox>
<br />
<br />

<asp:Repeater id="customers" runat="server">
<HeaderTemplate>
<table border="1" width="50%">
<tr bgcolor="#2D80DB">
<td>
ID</td>
<td>
Major</td>
<td>
First Name</td>
<td>
Last Name</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr bgcolor="#C1C8D2">
<td>
<%#Container.DataItem("id")%></td>
<td>
<%#Container.DataItem("major")%></td>
<td>
<%#Container.DataItem("first_name")%> 
</td>
<td>
<%#Container.DataItem("last_name")%> 
</td>
</tr>
</ItemTemplate>
<alternatingitemtemplate>
<tr bgcolor="#D1D9CC">
<td>
<%#Container.DataItem("id")%></td>
<td>
<%#Container.DataItem("major")%></td>
<td>
<%#Container.DataItem("first_name")%> 
</td>
<td>
<%#Container.DataItem("last_name")%> 
</td>
</tr>
</alternatingitemtemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<asp:Button id="Button1" onclick="submit" runat="server" Text="Submit"></asp:Button>
</form>
</body>
</html>
sanjeev
__________________
sanjeev




Similar Threads
Thread Thread Starter Forum Replies Last Post
[Microsoft][ODBC SQL Server Driver] TIME OUT ERROR rtr1900 ASP.NET 2.0 Basics 1 November 12th, 2008 09:36 AM
ODBC Microsoft Access Driver Issue mat41 Classic ASP Professional 5 June 30th, 2008 10:37 AM
[Microsoft][ODBC SQL Driver]Connection is busy muthumari_p2003@yahoo.com Pro JSP 0 May 8th, 2006 07:51 AM
[Microsoft][ODBC Microsoft Access Driver] Syntax e chinedu Classic ASP Databases 3 November 18th, 2004 03:48 PM
[ODBC Microsoft Access Driver] !!!Error!!! Varg_88 Classic ASP Databases 3 August 30th, 2004 06:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.