WELOA.DAL/WEL/ls_publicclass.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using WELOA.Model;

namespace LSDAL_SQL
{
    public class ls_publicclass
    {
        
        private ls_exception exlog = new ls_exception();
        private Polytechnic trinfo = new Polytechnic();

        
        public Polytechnic delField(string strTable, string strField)
        {
            this.trinfo.rowsnum = -1;
            this.trinfo.nException = -1;
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandType = CommandType.Text;
                command.CommandText = "alter table " + strTable + " drop column " + strField + " ";
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
                    command.ExecuteNonQuery();
                    this.trinfo.rowsnum = 1;
                }
                catch (Exception exception)
                {
                    this.exlog.insexception("ls_publicclass.cs delField", exception.Message);
                    this.trinfo.nException = 1;
                    return this.trinfo;
                }
            }
            return this.trinfo;
        }

        public Polytechnic insField(string strTable, string strField)
        {
            this.trinfo.rowsnum = -1;
            this.trinfo.nException = -1;
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandType = CommandType.Text;
                command.CommandText = "alter table " + strTable + " add " + strField;
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
后面还有 169 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。