|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 28th, 2008, 01:50 AM
|
|
Authorized User
|
|
Join Date: Nov 2007
Location: patna, bihar, India.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |