数据访问类SqlClient
using System; using System.ComponentModel; using System.Collections; using System.Diagnostics; using System.Data; using System.Data.SqlClient; using System.Configuration; using Microsoft.Win32; using System.IO; using System.Windows.Forms; namespace Sun.WebExam { public class DB : IDisposable { // 连接数据源 private SqlConnection con; /**/ /// <summary> /// 执行存储过程 /// </summary> /// <param name="procName"> 存储过程的名称 </param> /// <returns> 返回存储过程返回值 </returns> public int RunProc( string procName) { SqlCommand cmd = CreateCommand(procName, null ); cmd.ExecuteNonQuery(); this .Close(); return ( int )cmd