您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->WebQuest发布系统源码及文档>>App-Code/Subjects.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:WebQuest发布系统源码及文档
当前文件:文件类型 WebQuest/App_Code/Subjects.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using System.Web.Security; 6using System.Web.UI; 7using System.Web.UI.WebControls; 8using System.Web.UI.WebControls.WebParts; 9using System.Web.UI.HtmlControls; 10using System.Data.OleDb; 11//该源码下载自www.51aspx.com(51aspx.com) 12 13/// <summary> 14/// Subjects 的摘要说明 15/// </summary> 16namespace WebQuest 17{ 18 私有成员及属性 50 public int Create() 51 { 52 try 53 { 54 AccessDB myObj = new AccessDB(); 55 myObj.SqlStr = "insert into webquest_subjects(subjectname,description) values('" + _subjectName + "','" + _description + "') "; 56 myObj.ExecuteSqlStr(); 57 return 0; 58 } 59 catch (Exception a) 60 { 61 62 throw a; 63 return -1; 64 } 65 } 66 public DataSet Retrieve() 67 { 68 AccessDB myObj = new AccessDB(); 69 myObj.SqlStr = "select * from webquest_subjects "; 70 return myObj.ExecuteSqlStrReturnDs(); 71 } 72 public int Update() 73 { 74 try 75 { 76 AccessDB myObj = new AccessDB(); 77 myObj.SqlStr = "update webquest_subjects set subjectname='"+_subjectName+"',description='"+_description+"' where subjectid="+_subjectId.ToString(); 78 myObj.ExecuteSqlStr(); 79 return 0; 80 } 81 catch (Exception a) 82 { 83 84 throw a; 85 return -1; 86 } 87 } 88 public int Delete() 89 { 90 try 91 { 92 AccessDB myObj = new AccessDB(); 93 myObj.SqlStr = "delete from webquest_subjects where subjectid=" + _subjectId.ToString(); 94 myObj.ExecuteSqlStr(); 95 return 0; 96 } 97 catch (Exception a) 98 { 99 100 throw a; 101 return -1; 102 } 103 } 104 public OleDbDataReader RetrieveById() 105 { AccessDB myObj = new AccessDB(); 106 myObj.SqlStr = "select * from webquest_subjects where subjectid=" + _subjectId.ToString(); 107 return myObj.ExecuteSqlStrReturnDr(); 108 } 109 public Subjects() 110 { 111 // 112 // TODO: 在此处添加构造函数逻辑 113 // 114 } 115 } 116 117}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:WebQuest发布系统源码及文档
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号