I have an ASPX page in which I am trying to bind a datagrid to a dataset
pulled from Microsoft Access DB using code inline method. For some reason,
the compiler is having a problem with 'using'. Any help here would be much
appreciated. Thanks!
Getting the following error:
CS1519: Invalid token 'using' in class, struct, or interface member
declaration
My Code:
<%@ Page Language="C#" %>
<script runat="server">
using System.Data;
using System.Data.ole db;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
private void Form_Load(objec t sender, System.EventArg s e)
{
// create a connection string
string connString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=C:\Dev\A TTRIBUTES_VH\AT TRIBUTES_VH.mdb ";
OleDbConnection myConnection = new OleDbConnection ();
myConnection.Co nnectionString = connString;// create a data adapter
OleDbDataAdapte r da = new OleDbDataAdapte r("Select * from mytable",
myConnection);
// create a new dataset
DataSet ds = new DataSet();
// fill dataset
da.Fill(ds, "RateCenter s");
// Attach DataSet to DataGrid
DataGrid1.DataS ource = ds.DefaultViewM anager;
DataGrid1.datab ind()
myConnection.cl ose()
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:DataGrid id="DataGrid1" runat="server"> </asp:DataGrid>
</form>
</body>
</html> 4 4725
"Erik H." <er*********@ww ireless.com> wrote in message
news:uG******** ******@TK2MSFTN GP10.phx.gbl... I have an ASPX page in which I am trying to bind a datagrid to a dataset pulled from Microsoft Access DB using code inline method. For some reason, the compiler is having a problem with 'using'. Any help here would be much appreciated. Thanks!
Getting the following error: CS1519: Invalid token 'using' in class, struct, or interface member declaration
My Code: <%@ Page Language="C#" %> <script runat="server">
using System.Data; using System.Data.ole db; using System.Web.UI; using System.Web.UI.W ebControls; using System.Web.UI.H tmlControls;
Remember you're not writing C#, you're writing input for the ASP.NET
precompiler which will become C#.
The precompiler replaces tags like:
<%@ import namespace="Syst em.Data.oledb" %>
with C# using statements.
David
So when I'm using the code inline method, I need to use <%@ import
namspace="<name space>"%> instead?
Sorry if this is a stupid question, I just want to be clear.
Thanks David!
"David Browne" <davidbaxterbro wne no potted me**@hotmail.co m> wrote in
message news:#W******** ******@TK2MSFTN GP12.phx.gbl... "Erik H." <er*********@ww ireless.com> wrote in message news:uG******** ******@TK2MSFTN GP10.phx.gbl... I have an ASPX page in which I am trying to bind a datagrid to a dataset pulled from Microsoft Access DB using code inline method. For some
reason, the compiler is having a problem with 'using'. Any help here would be
much appreciated. Thanks!
Getting the following error: CS1519: Invalid token 'using' in class, struct, or interface member declaration
My Code: <%@ Page Language="C#" %> <script runat="server">
using System.Data; using System.Data.ole db; using System.Web.UI; using System.Web.UI.W ebControls; using System.Web.UI.H tmlControls;
Remember you're not writing C#, you're writing input for the ASP.NET precompiler which will become C#. The precompiler replaces tags like:
<%@ import namespace="Syst em.Data.oledb" %>
with C# using statements.
David
Thanks for the help on this. Not getting the error anymore...
"Erik H." <er*********@ww ireless.com> wrote in message
news:uU******** ******@TK2MSFTN GP11.phx.gbl... So when I'm using the code inline method, I need to use <%@ import namspace="<name space>"%> instead?
Sorry if this is a stupid question, I just want to be clear.
Thanks David!
"David Browne" <davidbaxterbro wne no potted me**@hotmail.co m> wrote in message news:#W******** ******@TK2MSFTN GP12.phx.gbl... "Erik H." <er*********@ww ireless.com> wrote in message news:uG******** ******@TK2MSFTN GP10.phx.gbl... I have an ASPX page in which I am trying to bind a datagrid to a
dataset pulled from Microsoft Access DB using code inline method. For some reason, the compiler is having a problem with 'using'. Any help here would be much appreciated. Thanks!
Getting the following error: CS1519: Invalid token 'using' in class, struct, or interface member declaration
My Code: <%@ Page Language="C#" %> <script runat="server">
using System.Data; using System.Data.ole db; using System.Web.UI; using System.Web.UI.W ebControls; using System.Web.UI.H tmlControls;
Remember you're not writing C#, you're writing input for the ASP.NET precompiler which will become C#. The precompiler replaces tags like:
<%@ import namespace="Syst em.Data.oledb" %>
with C# using statements.
David
"Erik H." <er*********@ww ireless.com> wrote in message
news:uU******** ********@TK2MSF TNGP11.phx.gbl. .. So when I'm using the code inline method, I need to use <%@ import namspace="<name space>"%> instead?
Sorry if this is a stupid question, I just want to be clear.
Yes. And poke around in the generated C# source files, they are your window
into what the ASP.NET precomiler is doing.
David This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Zach |
last post by:
Using Dev-C++ 4.9.8.5 I get error:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\winroot\src\c++\stupid_tricks\functor_trick.cpp" -o
"C:\winroot\src\c++\stupid_tricks\functor_trick.exe"
-I"C:\DEV-CPP\include\c++" -I"C:\DEV-CPP\include\c++\mingw32"
-I"C:\DEV-CPP\include\c++\backward" -I"C:\DEV-CPP\include"
-L"C:\DEV-CPP\lib"
C:/winroot/src/c++/stupid_tricks/functor_trick.cpp: In member function
|
by: Franko |
last post by:
I get the following error. Please help
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6,38): error CS1001:
Identifier expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6,52): error CS1002:
; expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(7,19): error CS1519:
Invalid token '(' in class, struct, or interface member declaration
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(9,2): error CS0116: A
namespace does not...
|
by: Franko |
last post by:
I get the following error. Please help
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6,38): error CS1001:
Identifier expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6,52): error CS1002:
; expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(7,19): error CS1519:
Invalid token '(' in class, struct, or interface member declaration
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(9,2): error CS0116: A
namespace does not...
|
by: s.caron |
last post by:
Hi,
I'm trying to open an aspx page but I have this error
Compiler Error Message: CS1519: Invalid token '=' in class, struct, or
interface member declaration
in the line : usuario.Credentials =
System.Net.CredentialCache.DefaultCredentials;
If I put this code in a method like Page_load
|
by: Erik H. |
last post by:
I have an ASPX page in which I am trying to bind a datagrid to a dataset
pulled from Microsoft Access DB using code inline method. For some reason,
the compiler is having a problem with 'using'. Any help here would be much
appreciated. Thanks!
Getting the following error:
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify...
| |
by: Twanger |
last post by:
I'm getting a compiler error on my ASP.NET page and I can't see the
cause. I have a simple C# class compiled into a DLL and placed in my
bin directory which has a public property QuestionText. When I try
and set the property the compiler throws up
Compiler Error Message: CS1519: Invalid token '=' in class, struct, or
interface member declaration
If I don't try and set the property it prints out the default value of
the property fine.
|
by: Pucca |
last post by:
Hi I'm using vs2005. I am getting a bunch of compiler warnings after I made
some changes to my code that was compiling clean. I'm also getting memory
errors when I run my program and it's pinvoking some C++ code, which was
working also fine before. I wonder if these warning are causing the problem.
I would appreciate some help or suggestions on how to correct these. Thanks.
Warning 37 At least one of the arguments for...
|
by: BSand0764 |
last post by:
I'm getting an error that I can't seem to resolve. When I compile the
Functor related logic in a test program, the files compile and execute
properly (see Listing #1).
However, when I incorporate the same logic within my simulation, the
class that implements the functor logic has problems compiling. I get
the following errors:
-- Building myTest.cpp --
|
by: markryde |
last post by:
Hello,
Followed here is a simplified code example of something which I
try to implement; in essence , I want to assign a value to a return
value of a method is C. I know, of course, that in this example I
can
get this by newskb->iph = iphdr (this also appears in a commented
line in the example below) ; but I want to achieve the same where
the left side is : ip_hdr(newskb). Alas, if I try this , I get
a compilation error about line 25....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |