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 ;)