[Mono-list] Databind to SQLServer

Adam W Root rootad@engr.orst.edu
15 May 2003 23:32:40 -0700


You need to add an Import directive:

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

If it says it can't find the assembly, use an Assembly directive (the
syntax here is iffy, but i think it's right):

<%@ Assembly name="System.Data.dll" %>

Good luck!



On Thu, 2003-05-15 at 23:16, Jones, Larry wrote:
> I already got it with:
> 
> mcs myclass.cs -r System.Data.dll
> 
> But haven proven that I can access MS SQL Server from a C# program, I now
> have the same problem of it not recognizing the System.Data Class from an
> ASP.NET page.
> 
> Larry Jones
> Hydrel/Lithonia Lighting
> 
> 
> -----Original Message-----
> From: Mark Gimelfarb [mailto:mgimelfarb@configtech.com]
> Sent: Thursday, May 15, 2003 9:49 PM
> To: mono-list@lists.ximian.com
> Subject: RE: [Mono-list] Databind to SQLServer
> 
> 
> 
> The syntax is 
> 
> mcs /r:System.Data myclass.cs
> 
> You might have to include the full filename for the assembly, depending
> on your mono config.
> 
> Good luck,
> 
> Mark.
> 
> 
> -----Original Message-----
> From: mono-list-admin@lists.ximian.com
> [mailto:mono-list-admin@lists.ximian.com] On Behalf Of John BouAntoun
> Sent: Thursday, May 15, 2003 11:40 PM
> To: Jones, Larry; mono-list@lists.ximian.com
> Subject: RE: [Mono-list] Databind to SQLServer
> 
> You need to reference the assemnlies that those Namespaces are in.
> 
> simply including a :
> 
> using [Namespace]
> 
> Statement at the top of a c# file is not enough. The compiler needs to
> know what binary (i.e. what Assmebly) that Namespace is in.
> 
> Both System.Data and System.Data.SqlClient are in the System.Data.Dll
> assembly.
> 
> When compiling your project you need to pass in all the assemblies you
> want the compiler to reference for your files (i.e. all the assemblies
> that your 'using' statements need.
> 
> I'm not quite sure off the top of my head the syntax for assembly
> references in mcs is, but do a mcs /? or man mcs and it will explain
> 
> JBA
> 
> -----Original Message-----
> From: Jones, Larry [mailto:LJones@Lithonia.com]
> Sent: Friday, 16 May 2003 2:27 PM
> To: John BouAntoun
> Subject: RE: [Mono-list] Databind to SQLServer
> 
> 
> I have these:
> 
>  using System;
>  using System.Data;
>  using System.Data.SqlClient;
> 
> just as in the sample.
> 
> Larry Jones
> Hydrel/Lithonia Lighting
> 
> 
> -----Original Message-----
> From: John BouAntoun [mailto:jbouantoun@rogen.com.au]
> Sent: Thursday, May 15, 2003 9:29 PM
> To: Jones, Larry
> Subject: RE: [Mono-list] Databind to SQLServer
> 
> 
> are you referencing the System.Data Assembly?
> 
> -----Original Message-----
> From: Jones, Larry [mailto:LJones@Lithonia.com]
> Sent: Friday, 16 May 2003 2:20 PM
> To: 'mono-list@lists.ximian.com'
> Subject: [Mono-list] Databind to SQLServer
> 
> 
> OK, I tried the sample program for Sql Server in the doc, which is just
> straight C#, not ASP.NET, and the compile fails on:
> 
> The namespace 'System.Data' can not be found 
> and
> The namespace 'System.Data.SqlClient' can not be found
> 
> Help guys.
> 
> Larry Jones
> Hydrel/Lithonia Lighting
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list