J'ajoute DLL dans l'application Web mais cette DLL ne peut pas accéder aux noms de classe Quel est le problème?

StackOverflow https://stackoverflow.com/questions/7429281

  •  30-10-2019
  •  | 
  •  

Question

J'utilise une DLL (newdao.dll) dans l'application Web. Il a un fichier CS, je peux accéder à ce nom de classe dans l'application Web mais il n'est pas venu quel est le problème, pls me donne une suggestion

Dans le nom de newdao, la classe d'espace est dbconnection que le code est

  using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace NEWDAO
{
    class DbConnection
    {
        private int _EmpName;
        private string _Name;
        private decimal _Salary;
        private DateTime _CreatedDate;
        public bool Flag = false;
        DataSet ds = new DataSet();
        SqlConnection m_Con = new SqlConnection("Server=*******,dataSource=Test,user name=sa,password=*******");
        SqlCommand m_Cmd = new SqlCommand();

        public int EmpNo
        {
            get
            {
                return _EmpName;
            }
            set
            {
                _EmpName = value;
            }
        }

        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
            }
        }

        public decimal Salary
        {
            get
            {
                return _Salary;
            }
            set
            {
                _Salary = value;
            }
        }

        public DateTime CreatedDate
        {
            get
            {
                return _CreatedDate;
            }
            set
            {
                _CreatedDate = value;
            }
        }
        /// <summary>
        /// Insert the Emp values
        /// </summary>
        public bool EmpInsert()
        {
            Flag = false;
            m_Con.Open();
            SqlCommand m_Cmd = new SqlCommand("usp_EmpInsert", m_Con);
            m_Cmd.CommandType = CommandType.StoredProcedure;
            m_Cmd.Parameters.AddWithValue("@EmpName", EmpNo);
            m_Cmd.Parameters.AddWithValue("@Name", Name);
            m_Cmd.Parameters.AddWithValue("@Salary", Salary);
            m_Cmd.Parameters.AddWithValue("@CreatedDate", CreatedDate);
            if (m_Cmd.ExecuteNonQuery() >= 0)
            {
                Flag = true;
                return Flag;

            }
            else
            {
                return Flag;
            }
            m_Con.Close();
        }

        /// <summary>
        /// Display the values
        /// </summary>
        public bool EmpSelect(out DataSet oDS)
        {
            Flag = false;
            m_Con.Open();
            SqlCommand m_Cmd = new SqlCommand("usp_EmpInsert", m_Con);
            m_Cmd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter ad = new SqlDataAdapter("usp_EmpInsert", m_Con);
            ad.Fill(ds, "EMP");
            if (ds != null)
            {
                oDS = ds;
                Flag = true;
                return Flag;
            }
            else
            {
                oDS = null;
                return Flag;
            }
            m_Con.Close();

        }
    }
}

Merci HeManth

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top