C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
What's wrong with my code? Posted by theobsession on 21 May 2001 at 11:10 PM
Hi guys,
I made an ASP.NET page in C#.
I get a compilation error when I try to view it in my browser.
"Description: An error occurred during the compilation of a resource required to service this request. Please review the specific error details below and modify your source code appropriately.

Compiler Error Message: CS1513: } expected"
I don't see anything with this code, maybe you guys can figure out what it is:

<% Import Namespace="System.Data" %>
<% Import Namespace= "System.Data.SQL" %>

<script language="c#" runat="server">

protected void Page_Load(Object Src, EventArgs E )
{
stringsConnStr="server=localhost;uid=sa;pwd=;database=ibs2";
SQLConnection myCn = new SQLConnection(sConnStr);

String sSQL = "select * from slaps";
SQLDataSetCommand MyDSCmd = new SQLDataSetCommand(sSQL, myCn);
</script>
<td align=left valign="top" width=100% nowrap>
<table height="100%" valign="top" align="left" cellspacing=0 cellpadding=0 width="100%" border=0>
<tr height="100%" valign="top">
<td nowrap>
<br>

<asp:DataList id="MyList" RepeatColumns="2" runat="server">

<template name="ItemTemplate">

<table border=0 width="300">
<tr>
<td with="25"> </td>
<td width="100" valign="center" align=right>
<a href='ProductDetails.aspx?productID=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>'>
<img src='ProductImages/thumbs/<%# DataBinder.Eval(Container.DataItem, "ProductImage") %>' width="100" height="75" border="0">
</a>
</td>
<td width="200" valign="center">
<a href='ProductDetails.aspx?productID=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>'>
<span class="ProductListHeader"><%# DataBinder.Eval(Container.DataItem, "ModelName") %></span><br><%# DataBinder.Eval(Container.DataItem, "Description") %>
<img src="file:///C|/My%20Documents/Obsessed%20Mind/Drafts/6.0/blackarrow2.gif" width="14" height="7" border="0">
<font color="#00CC33"><b><font size="1" face="Arial, Helvetica, sans-serif" color="#009900">Tell me more...
</font></b></font>
</a>
<span class="ProductListItem"><b>Special Price: </b><%# DataBinder.Eval(Container.DataItem, "UnitCost", "{0:c}") %></span><br>
<a href="AddToCart.aspx?productID=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>">
<span class="ProductListItem"><font color="#9D0000"><b>Add To Cart<b></b></b></font></span>
</a>
</td>
</tr>
</table>

</template>

</asp:DataList>

</td>
</tr>
</table>
</td>

Report
Re: What's wrong with my code? Posted by asif_a_siddiqi on 11 Jul 2001 at 8:51 AM
You missed a } at the end of the function - here's the fix -->

: Hi guys,
: I made an ASP.NET page in C#.
: I get a compilation error when I try to view it in my browser.
: "Description: An error occurred during the compilation of a resource required to service this request. Please review the specific error details below and modify your source code appropriately.
:
: Compiler Error Message: CS1513: } expected"
: I don't see anything with this code, maybe you guys can figure out what it is:
:
: <% Import Namespace="System.Data" %>
: <% Import Namespace= "System.Data.SQL" %>
:
: <script language="c#" runat="server">
:
: protected void Page_Load(Object Src, EventArgs E )
: {
: stringsConnStr="server=localhost;uid=sa;pwd=;database=ibs2";
: SQLConnection myCn = new SQLConnection(sConnStr);
:
: String sSQL = "select * from slaps";
: SQLDataSetCommand MyDSCmd = new SQLDataSetCommand(sSQL, myCn);
} // <---you missed a } here
: </script>
: <td align=left valign="top" width=100% nowrap>
: <table height="100%" valign="top" align="left" cellspacing=0 cellpadding=0 width="100%" border=0>
: <tr height="100%" valign="top">
: <td nowrap>
:
:
: <asp:DataList id="MyList" RepeatColumns="2" runat="server">
:
: <template name="ItemTemplate">
:
: <table border=0 width="300">
: <tr>
: <td with="25"> </td>
: <td width="100" valign="center" align=right>
: <a href='ProductDetails.aspx?productID=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>'>
: <img src='ProductImages/thumbs/<%# DataBinder.Eval(Container.DataItem, "ProductImage") %>' width="100" height="75" border="0">
: </a>
: </td>
: <td width="200" valign="center">
: <a href='ProductDetails.aspx?productID=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>'>
: <span class="ProductListHeader"><%# DataBinder.Eval(Container.DataItem, "ModelName") %></span><%# DataBinder.Eval(Container.DataItem, "Description") %>
: <img src="file:///C|/My%20Documents/Obsessed%20Mind/Drafts/6.0/blackarrow2.gif" width="14" height="7" border="0">
: <font color="#00CC33"><b><font size="1" face="Arial, Helvetica, sans-serif" color="#009900">Tell me more...
: </font></b></font>
: </a>
: <span class="ProductListItem"><b>Special Price: </b><%# DataBinder.Eval(Container.DataItem, "UnitCost", "{0:c}") %></span>
: <a href="AddToCart.aspx?productID=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>">
: <span class="ProductListItem"><font color="#9D0000"><b>Add To Cart<b></b></b></font></span>
: </a>
: </td>
: </tr>
: </table>
:
: </template>
:
: </asp:DataList>
:
: </td>
: </tr>
: </table>
: </td>
:





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.