📄 connection.cs
字号:
using System;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
namespace WebApplication8.firstPage
{
/// <summary>
/// Connection 的摘要说明。
/// </summary>
public class Connection
{
SqlConnection connection;
SqlCommand command;
public Connection(string c)
{
//
// TODO: 在此处添加构造函数逻辑
//
connection = new SqlConnection();
command = new SqlCommand();
connection.ConnectionString = c;
command.Connection = connection;
connection.Open();
}
public SqlDataReader execute(string sql)
{
command.CommandText = sql;
return command.ExecuteReader();
}
public void close()
{
connection.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -