topicaccessor.cs
来自「入门级asp.netC#网站三层系统开发」· CS 代码 · 共 36 行
CS
36 行
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using Common;
using Common.Entities;
namespace DAL.Accessor
{
public class TopicAccessor
{
//查询专题总数
public int GetTopicNum()
{
using (SqlConnection conn = new SqlConnection())
{
conn.ConnectionString = SqlHelper.ConnectionStringLocalTransaction;
int count = int.Parse(SqlHelper.ExecuteScalar(conn, CommandType.StoredProcedure, "Topic_GetCount", null).ToString());
return count;
}
}
//专题列表
public SqlDataReader GetList()
{
SqlDataReader reader;
using (SqlConnection conn = new SqlConnection())
{
conn.ConnectionString = SqlHelper.ConnectionStringLocalTransaction;
reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, "Topic_GetList", null);
}
return reader;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?