Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 08: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 02:48 PM
[ODBC Microsoft Access Driver] !!!Error!!! Varg_88 Classic ASP Databases 3 August 30th, 2004 06:19 AM



All times are GMT -4. The time now is 11:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.