The name 'DAL' does not exist in the current context
با سلام
من یک پروژه چند لایه دارم که دارای دو لایه DAL و BLL هست.
زمانی که میخوام از لایه BLL، لایه DAL فراخونی کنم با این پیغام مواجه میشم.
نقل قول:
The name 'DAL' does not exist in the current context
ریفرنس لایه DAL به BLL هم انجام شده
BLL Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace BLL
{
public class Panel
{
public static SqlDataReader GetInformationPanel(string PanelId)
{
SqlDataReader RetVal = DAL.Panel.GetInformationPanel(PanelId);
return RetVal;
}
}
}
DAL Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
public class Panel
{
public static SqlDataReader GetInformationPanel(string PanelId)
{
SqlDataReader Val = DALBase.EReader("select * from TBLPanel where PanelId = " + PanelId + "", System.Data.CommandType.Text, new SqlParameter[] { });
return Val;
}
}
}
نقل قول: The name 'DAL' does not exist in the current context
سلام
شما شاید لایه BL رو به رفرنس لایه DAL اضافه کرده باشید که باید بر عکس باشد.
بعد اگه درست رفرنس رو اضافه کردی چرا در لایه BL لایه DAL رو Using اضافه نکردین.
using DAL;
نقل قول: The name 'DAL' does not exist in the current context
نقل قول:
نوشته شده توسط
ebrahim.rayatparvar
سلام
شما شاید لایه BL رو به رفرنس لایه DAL اضافه کرده باشید که باید بر عکس باشد.
بعد اگه درست رفرنس رو اضافه کردی چرا در لایه BL لایه DAL رو Using اضافه نکردین.
using DAL;
دوست عزیز رفرنس درست انجام شده
با اضافه کردن Using DAL پیغام خطا زیر نمایش داده میشه
نقل قول:
The type or namespace name 'DAL' could not be found (are you missing a using directive or an assembly reference
ممنون از وقتی که گذاشتین
نقل قول: The name 'DAL' does not exist in the current context
برای لایه UI هر دو لایه باید در رفرنس اضافه بشه و هر نیز using.
نقل قول: The name 'DAL' does not exist in the current context
نقل قول:
نوشته شده توسط
ebrahim.rayatparvar
برای لایه UI هر دو لایه باید در رفرنس اضافه بشه و هر نیز using.
دوست عزیز اگر منظور شما اینه که لایه DAL و BLL به لایه UI رفرنس بدم، این کارو انجام دادم
باتشکر