bc... []

Datacon.cs ( File view )

  • By aiskfjfs1 2015-05-02
  • View(s):4
  • Download(s):0
  • Point(s): 1
			using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.ComponentModel;
using System.Diagnostics;
using System.Data.SqlClient;
using MyWeb.DataAccessHelper;
//namespace MyWeb.DataAccessLayer
//{

    public class Datacon
    {

        public SqlConnection getcon()
        {

            //请修改此处的连接代码
            string strCon = "server=.\\sql2008;database=Examination;Integrated Security=True";
            SqlConnection sqlCon = new SqlConnection(strCon);
            return sqlCon;
        
}

        public bool eccom(string sqlstr)
        {

            SqlConnection cn = this.getcon();
            cn.Open();
            SqlCommand cmd = new SqlCommand(sqlstr, cn);
            try
            {

                cmd.ExecuteNonQuery();
                return true;
            
}
            catch
            {

                return false;
            
}
            finally
            {

                cn.Close();
            
}
        
}
        public SqlParameter MakeParam(string ParamName, SqlDbType DbType, Int32 Size, ParameterDirection Direction, object Value)
        {

            SqlParameter Param;

            if (Size > 0)
                Param = new SqlParameter(ParamName, DbType, Size);
            else Param = new SqlParameter(ParamName, DbType);

            Param.Direction = Direction;

            if (Value != null)
                Param.Value = Value;

            return Param;
        
}
        public SqlParameter MakeInParam(string ParamName, SqlDbType DbType, int Size, object Value)
        {

            return MakeParam(ParamName, DbType, Size, ParameterDirection.Input, Value);
        
}


        public void bind(GridView gv, string sqlstr)
        {

            SqlConnection cn = this.getcon();
            cn.Open();
            SqlDataAdapter mydata = new SqlDataAdapter(sqlstr, cn);
            DataSet mydataset = new DataSet();
            mydata.Fill(mydataset);
            gv.DataSource = mydataset;
            gv.DataBind();
            cn.Close();

        
}


        public bool ecDropDownList(DropDownList DDL, string sqlstr, string DTF, string DVF)
        {

            SqlConnection cn = this.getcon();
            cn.Open();
            SqlDataAdapter mydata = new SqlDataAdapter(sqlstr, cn);
            DataSet mydataset = new DataSet();
            mydata.Fill(mydataset);
            DDL.DataSource = mydataset;
            DDL.DataTextField = DTF;
            DDL.DataValueField = DVF;
            try
            {

                DDL.DataBind();
                return true;
            
}
            catch
            {

                return false;
            
}
            finally
            {

                cn.Close();
            
}
        
}


        public void bindinfostring(GridView gv, string sqlstr, string DNK)
        {

            SqlConnection cn = this.getcon();
            cn.Open();
            SqlDataAdapter mydata = new SqlDataAdapter(sqlstr, cn);
            DataSet mydataset = new DataSet();
            mydata.Fill(mydataset);
            gv.DataSource = mydataset;
            gv.DataKeyNames = new string[] {
 DNK 
};
            gv.DataBind();
            cn.Close();
        
}


        public SqlDataReader ExceRead(string SqlCom)
        {

            SqlConnection cn = this.getcon();
            cn.Open();
            SqlCommand sqlcom = new SqlCommand(SqlCom, cn);
            SqlDataReader read = sqlcom.ExecuteReader();
            return read;
        
}
        public DataSet GetDataSet(string ProcName)
        {

            SqlConnection cn = this.getcon();
            cn.Open();
            SqlDataAdapter adapter = new SqlDataAdapter(ProcName, cn);
            DataSet dataset = new DataSet();
            adapter.Fill(dataset);
            cn.Close();
            return dataset;
        
}
        public DataSet GetDataSet(string ProcName, SqlParameter[] Params)
        {

            SqlConnection cn = this.getcon();
            cn.Open();
            SqlCommand Cmd = CreateCommand(ProcName, Params);
            SqlDataAdapter adapter = new SqlDataAdapter(Cmd);
            DataSet dataset = new DataSet();
            adapter.Fill(dataset);
            cn.Close();
            return dataset;
        
}
        public DataSet GetDataSetSql(string XSqlString)
        {

            SqlConnection cn = this.getcon();
            cn.Open();

            SqlDataAdapter Adapter = new SqlDataAdapter(XSqlString, cn);
            DataSet Ds = new DataSet();
            Adapter.Fill(Ds);
            cn.Close();
            return Ds;
        
}
        public int Insert(string XSqlString)
        {

            int Count = -1;
            SqlConnection cn = this.getcon();
            cn.Open();
            SqlCom
...
...
(Please download the complete source code to view)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
AddAdmin.aspx3.04 kB19-05-13|22:35
AddAdmin.aspx.cs1.71 kB19-05-13|22:35
AddStudent.aspx6.75 kB19-05-13|22:35
AddStudent.aspx.cs1.71 kB17-05-13|22:53
AddTeacher.aspx3.73 kB19-05-13|22:35
AddTeacher.aspx.cs1.59 kB17-05-13|22:53
admin.aspx7.89 kB17-05-13|22:53
admin.aspx.cs955.00 B08-10-13|10:02
ChangePwd.aspx438.00 B17-05-13|22:53
ChangePwd.aspx.cs285.00 B17-05-13|22:53
ManageAdmin.aspx5.86 kB18-05-13|13:50
ManageAdmin.aspx.cs4.41 kB17-05-13|22:53
ManageStudent.aspx8.11 kB17-05-13|22:53
ManageStudent.aspx.cs4.83 kB17-05-13|22:53
ManageTeacher.aspx6.72 kB19-05-13|12:11
ManageTeacher.aspx.cs4.72 kB17-05-13|22:53
JudgeProblem.cs3.63 kB18-05-13|12:50
MultiProblem.cs5.66 kB17-05-13|22:53
Paper.cs4.52 kB18-05-13|23:28
Scores.cs4.80 kB18-05-13|00:05
SingleProblem.cs5.64 kB17-05-13|22:53
GetSafeData.cs2.58 kB18-05-13|23:09
Datacon.cs7.59 kB08-10-13|09:57
code.aspx427.00 B17-05-13|22:53
code.aspx.cs3.04 kB17-05-13|22:53
admin.css1.84 kB17-05-13|22:53
Common.css438.00 B17-05-13|22:53
Examination.ldf1.00 MB08-10-13|10:07
Examination.MDF3.00 MB08-10-13|10:07
1.png119.00 B17-05-13|22:53
1111.png23.30 kB17-05-13|22:53
2.png80.00 B17-05-13|22:53
2132.png122.00 B17-05-13|22:53
adelete.gif1.46 kB17-05-13|22:53
allselect.gif1.26 kB17-05-13|22:53
answer.png118.00 B17-05-13|22:53
b.jpg29.33 kB17-05-13|22:53
back.gif1.40 kB17-05-13|22:53
bc_1.gif15.86 kB17-05-13|22:53
cselect.gif1.45 kB17-05-13|22:53
exam_bc.png114.00 B17-05-13|22:53
exam_head.png1.24 kB17-05-13|22:53
footer.png120.00 B17-05-13|22:53
head_bg.png142.00 B17-05-13|22:53
home1.gif664.00 B17-05-13|22:53
hou.gif2.87 kB17-05-13|22:53
illust02_07.jpg11.35 kB17-05-13|22:53
lock.png2.06 kB17-05-13|22:53
login.jpg36.81 kB17-05-13|22:53
login.png432.00 B17-05-13|22:53
main_03.jpg47.11 kB17-05-13|22:53
management_01.jpg4.29 kB17-05-13|22:53
middle_center.png111.00 B17-05-13|22:53
navshape.jpg2.86 kB17-05-13|22:53
next.gif2.33 kB17-05-13|22:53
options_2.png1.78 kB17-05-13|22:53
pagebackgrad.gif1.06 kB17-05-13|22:53
que.gif389.00 B17-05-13|22:53
quit.gif1.39 kB17-05-13|22:53
RESET.GIF407.00 B17-05-13|22:53
search.gif424.00 B17-05-13|22:53
Submit.GIF389.00 B17-05-13|22:53
titlegraphic.gif1.27 kB17-05-13|22:53
tree_bg.png117.00 B17-05-13|22:53
tree_head.png162.00 B17-05-13|22:53
whitearrow.gif68.00 B17-05-13|22:53
index.aspx5.57 kB10-04-15|15:45
index.aspx.cs4.01 kB08-10-13|10:01
robots.txt211.00 B17-05-13|22:53
AddCourse.aspx1.58 kB17-05-13|22:53
AddCourse.aspx.cs1.50 kB17-05-13|22:53
AddDanXuan.aspx4.56 kB17-05-13|22:53
AddDanXuan.aspx.cs1.03 kB17-05-13|22:53
AddDuoXuan.aspx4.69 kB17-05-13|22:53
AddDuoXuan.aspx.cs9.95 kB19-05-13|11:49
AddPanDuan.aspx2.58 kB17-05-13|22:53
AddPanDuan.aspx.cs906.00 B17-05-13|22:53
AddTaoTi.aspx15.17 kB18-05-13|10:40
AddTaoTi.aspx.cs4.97 kB19-05-13|15:06
ChangeDanXuan.aspx4.56 kB17-05-13|22:53
ChangeDanXuan.aspx.cs2.79 kB17-05-13|22:53
ChangeDuoXuan.aspx4.92 kB19-05-13|20:47
ChangeDuoXuan.aspx.cs3.32 kB17-05-13|22:53
ChangePanDuan.aspx3.06 kB17-05-13|22:53
ChangePanDuan.aspx.cs2.64 kB17-05-13|22:53
ChangePwd.aspx2.98 kB17-05-13|22:53
ChangePwd.aspx.cs1.21 kB17-05-13|22:53
ManageCourse.aspx5.32 kB20-05-13|00:19
ManageCourse.aspx.cs4.53 kB19-05-13|21:11
ManageDanXuan.aspx3.63 kB18-05-13|23:30
ManageDanXuan.aspx.cs2.51 kB20-05-13|00:18
ManageDuoXuan.aspx3.55 kB18-05-13|23:30
ManageDuoXuan.aspx.cs2.36 kB20-05-13|00:18
ManagePanDuan.aspx3.55 kB18-05-13|23:30
ManagePanDuan.aspx.cs2.36 kB20-05-13|00:18
ManageScore.aspx3.14 kB17-05-13|22:53
ManageScore.aspx.cs1.48 kB19-05-13|23:52
ManageStudent.aspx3.47 kB17-05-13|22:53
ManageStudent.aspx.cs1.29 kB17-05-13|22:53
ManageTaoTi.aspx8.11 kB17-05-13|22:53
ManageTaoTi.aspx.cs4.81 kB19-05-13|17:15
TaoTiDetail.aspx9.51 kB18-05-13|10:47
TaoTiDetail.aspx.cs2.03 kB17-05-13|22:53
teacher.aspx8.67 kB09-04-15|20:00
teacher.aspx.cs944.00 B17-05-13|22:53
attention.aspx5.18 kB09-04-15|19:56
attention.aspx.cs695.00 B17-05-13|22:53
ChangePwd.aspx6.06 kB09-04-15|19:57
ChangePwd.aspx.cs1.34 kB17-05-13|22:53
ChoosePaper.aspx4.50 kB09-04-15|19:57
ChoosePaper.aspx.cs2.09 kB18-05-13|00:06
Exam.aspx18.72 kB09-04-15|19:57
Exam.aspx.cs7.63 kB17-05-13|22:53
getpwd1.aspx1.19 kB17-05-13|22:53
getpwd1.aspx.cs1.10 kB17-05-13|22:53
getpwd2.aspx1.57 kB17-05-13|22:53
getpwd2.aspx.cs1.45 kB17-05-13|22:53
getpwd3.aspx1.61 kB17-05-13|22:53
getpwd3.aspx.cs1.03 kB17-05-13|22:53
MasterPage.master2.03 kB09-04-15|20:10
MasterPage.master.cs295.00 B17-05-13|22:53
or.aspx4.51 kB09-04-15|19:58
or.aspx.cs751.00 B17-05-13|22:53
Score.aspx5.67 kB09-04-15|20:10
Score.aspx.cs1.30 kB20-05-13|00:19
wait.aspx1.43 kB17-05-13|22:53
wait.aspx.cs297.00 B17-05-13|22:53
zhuce.aspx8.36 kB09-04-15|20:00
zhuce.aspx.cs1.91 kB19-05-13|22:17
web.config1.11 kB08-10-13|09:54
在线考试系统.sln1.48 kB08-10-13|09:54
在线考试系统.suo16.00 kB09-04-15|21:58
BusinessLogicLayer0.00 B10-04-15|15:43
DataAccessHelper0.00 B10-04-15|15:43
Admin0.00 B10-04-15|15:43
App_Code0.00 B10-04-15|15:43
App_Data0.00 B08-10-13|10:09
css0.00 B10-04-15|15:43
DB0.00 B10-04-15|15:43
image0.00 B10-04-15|15:43
Teacher0.00 B10-04-15|15:43
User0.00 B10-04-15|15:43
在线考试系统0.00 B10-04-15|15:45
...

Datacon.cs (1.66 MB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D