Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2003, 11:39 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Namespace Help



i have de cs file already compiled. and also a .aspx page
to show the sql table.
the code is:
Listaserv.cs that gets me Listaserv.dll:

using System;
using System.Data;
using System.Data.SqlClient;


namespace Teste
{
public class Listaserv
{
public DataSet Listatel()
{
SqlConnection conn = new SqlConnection
("server=localhost;uid=sa;pwd=;database=pubs");
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand
("SELECT au_fname,au_lname,phone FROM Authors", conn);
DataSet objds = new DataSet();
adapter.Fill(objds);
return objds;
}
}
}

and the a i have de .aspx:

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

<html>

<form runat="server">
<h1>Lista de Telefones</h1>
<p><asp:DataGrid id="dglista"
Width="400"
BackColor="Yellow"
BorderColor="black"
ShowFooter="false"
CellPadding="3"
CellSpacing="0"
Font-Name="Courier"
Font-Size="8pt"
HeaderStyle-BackColor="lightGray"
runat="server"/></p>
</form>

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

protected void Page_Load (Object sender, EventArgs ea)
{
// criando datasetrs e recebendo dados
Listaserv objlt = new Listaserv();
DataSet dsvp = objlt.Listatel();

//preenchendo datagrid dglista

dglista.DataSource = dsvp.Tables["dsvListatel"].DefaultView;
dglista.DataBind();
}
</script>

and i have the error:
Compiler Error Message: CS0246: The type or namespace name 'Teste'
could not be found (are you missing a using directive or an assembly
reference?)

anyone can help me? a also have a config.web files:
<configuration>
<compilation>
<assemblies>
<add assembly="Listaserv"/>
</assemblies>
</compilation>
</configuration>

well, im new in C# and really don´t know how to solve this problem.
thanks ;)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Two namespace contain same name nir_pankaj C# 1 February 21st, 2007 12:30 PM
namespace Ibn_Aziz C# 2 December 25th, 2003 05:41 AM
namespace within namespace Bill Crawley XML 1 December 11th, 2003 10:59 AM
Namespace flute Pro VB.NET 2002/2003 2 October 21st, 2003 09:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.