I am adding dll in web application but that dll cannot access the class names what is the problem?

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

  •  30-10-2019
  •  | 
  •  

質問

I am using a dll(NEWDAO.dll) in web application. It has a cs file, I can access that class name in web application but it is not came what is the problem, pls give me any suggestion

in NEWDAO name space class is DBConnection code is

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

        }
    }
}

thank you hemanth

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top