Foros del Web » Programación para mayores de 30 ;) » C/C++ »

Nombre no existe en el contexto actual

Estas en el tema de Nombre no existe en el contexto actual en el foro de C/C++ en Foros del Web. Buenas tardes, por favor a ver si me pueden ayudar, tengo un código que me está arrojando el sgt mensaje Error 26 El nombre 'ListaPrecioDB' ...
  #1 (permalink)  
Antiguo 14/08/2012, 11:08
 
Fecha de Ingreso: agosto-2006
Mensajes: 56
Antigüedad: 17 años, 7 meses
Puntos: 0
Nombre no existe en el contexto actual

Buenas tardes, por favor a ver si me pueden ayudar, tengo un código que me está arrojando el sgt mensaje

Error 26 El nombre 'ListaPrecioDB' no existe en el contexto actual C:\Users\olcoba015\Documents\Fuentes\Marco15\Marco \WebSite\listaprecio.aspx.cs 19 15 C:\...\WebSite\
Tengo éste archivo ListaPrecioDB.cs
Código:
using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;

namespace MarcoDB
{
    public class ListaPrecioDB {
        public ListaPrecioDB() {}

        //inserta registros en la tabla lista de precio
        public static int AddLista(int CodigoOperacion, DateTime FechaAplicacion, DateTime FechaFin)
        {
            SqlHelper.ExecuteNonQuery(SystemFramework.connString, "AddLista",
                new SqlParameter("@CodigoOperacion", CodigoOperacion),
                new SqlParameter("@FechaAplicacion", FechaAplicacion),
                new SqlParameter("@FechaFin", FechaFin)
                );

          }
    }
}
(Como hasta ahora estoy comenzando solo tengo el Add, en el momento solo me interesa insertar los registros)

éste archivo lo llamo desde listaprecio.aspx.cs en el cual la línea ListaPrecioDB.AddLista(int.Parse(cboServicios.Sele ctedValue), txtFechaAplicacion.SelectedDate, txtFechaAplicacion.SelectedDate); me genera el error
Código:
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using MarcoDB;
public partial class listaprecio : System.Web.UI.Page
{
       protected void Button2_Click(object sender, EventArgs e)
    {
          try
          {
              ListaPrecioDB.AddLista(int.Parse(cboServicios.SelectedValue), txtFechaAplicacion.SelectedDate, txtFechaFin.SelectedDate);
                                  

               lblError.Text = "Lista Grabada Ok";
           }
            catch (Exception ex)
            {
              lblError.Text = ex.Message;
            }
      }
       protected void cboServicios_DataBound(object sender, EventArgs e)
       {
           cboServicios.Items.Insert(0, new ListItem("Seleccione Servicio", "0"));
       }
  }
y el archivo aspx es el sgt:

Código HTML:
Ver original
  1. <%@ Page Language="C#" MasterPageFile="~/MPMarco.master" AutoEventWireup="true" CodeFile="listaprecio.aspx.cs" Inherits="listaprecio"  Theme="Marco" %>
  2. <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
  3.  
  4. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  5.     <br />
  6.     <div style="text-align: center">
  7.         <table style="width: 720px">
  8.             <tr>
  9.                 <td class="titulosaplic" colspan="4">
  10.                     &nbsp;Lista de Precios</td>
  11.             </tr>
  12.                
  13.             <tr>
  14.                 <td class="Label" style="width: 100px; height: 22px">
  15.                     Servicio</td>
  16.                 <td style="width: 224px">
  17.                     <asp:DropDownList ID="cboServicios" runat="server" CssClass="text_normal" DataSourceID="PaisesDataSource"
  18.                        DataTextField="OperacionEspanol" DataValueField="IdOperacion" OnDataBound="cboServicios_DataBound"
  19.                        TabIndex="1">
  20.                     </asp:DropDownList>
  21.                 </td>
  22.                
  23.                
  24.                 </tr>
  25.                 <tr>
  26.                 <td align="left" class="label" nowrap="nowrap" style="height: 22px" width="10%">
  27.                 Desde</td>
  28.             <td style="height: 22px; width: 224px;">
  29.                 <radcln:raddatepicker id="txtFechaAplicacion" runat="server" width="115px"><DATEINPUT title="" CatalogIconImageUrl="" Description="" DisplayPromptChar="_" PromptChar=" " TitleIconImageUrl="" TitleUrl="" /></radcln:raddatepicker>
  30.             </td>
  31.             <td class="label" style="height: 22px">
  32.                 Hasta</td>
  33.             <td style="height: 22px">
  34.                 <radcln:raddatepicker id="txtFechaFin" runat="server" width="115px"><DATEINPUT title="" CatalogIconImageUrl="" Description="" DisplayPromptChar="_" PromptChar=" " TitleIconImageUrl="" TitleUrl="" /></radcln:raddatepicker>
  35.             </td>
  36.          
  37.            
  38.             </tr>
  39.                  <tr>
  40.                 <td colspan="4">
  41.                     <asp:Label ID="lblError" runat="server" EnableViewState="False" ForeColor="Red"></asp:Label></td>
  42.             </tr>
  43.              
  44.             <tr>
  45.                
  46.                 <td style="width: 264px">
  47.                     <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Aceptar"
  48.                         />&nbsp;
  49.                          <%--<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Cancelar"
  50.                        TabIndex="17" />--%>
  51.                     <%--<asp:Button ID="btnBorrar" runat="server" OnClick="btnBorrar_Click" Text="Eliminar" /></td>--%>
  52.                 <td class="Label" style="width: 224px; height: 26px">
  53.                 </td>
  54.                
  55.             </tr>
  56.             <tr>
  57.                
  58.                 <td style="width: 100px; height: 26px">
  59.                     <asp:SqlDataSource ID="PaisesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
  60.                        
  61.                         SelectCommand="SELECT IdOperacion, OperacionEspanol FROM dbo.Operaciones WHERE (IdOperacion = 1416) OR (IdOperacion = 1424) OR (IdOperacion = 1417) OR (IdOperacion = 1415) OR (IdOperacion = 1577) OR (IdOperacion = 1420) OR (IdOperacion = 1421) OR (IdOperacion = 1422) OR (IdOperacion = 1423) OR (IdOperacion = 1418) OR (IdOperacion = 1440)"></asp:SqlDataSource>
  62.                 </td>
  63.            
  64.           </tr>
  65.         </table>
  66.     </div>
  67. </asp:Content>

No se si es que hay un error que yo no veo, agradezco la ayuda que me puedan dar
  #2 (permalink)  
Antiguo 16/08/2012, 10:43
 
Fecha de Ingreso: agosto-2012
Mensajes: 30
Antigüedad: 11 años, 8 meses
Puntos: 3
Respuesta: Nombre no existe en el contexto actual

Hola

Oye, creo q has publicado tu pregunta en el foro equivocado. Este es de C/C++.

Hay uno de .net y asp. Tal vez si mueves tu mensaje alli, consigas una solucion mas pronta
  #3 (permalink)  
Antiguo 16/08/2012, 13:01
 
Fecha de Ingreso: agosto-2012
Mensajes: 94
Antigüedad: 11 años, 8 meses
Puntos: 7
Respuesta: Nombre no existe en el contexto actual

Si, cuando lo empece a ver, me parecio chino basico, jeje.

Etiquetas: actual, contexto, int, nombre, string
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:27.