⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sqldataprovider.cs

📁 1、用SQL查询器打开install目录下的dooogo.sql运行之后创建数据库dooogo。 2、然后打开web.config修改 <DbProvider type="Club.Fram
💻 CS
📖 第 1 页 / 共 5 页
字号:
									   SqlHelper.MakeInParam("@EducationID",System.Data.SqlDbType.Int,4,_c_UserDataInfo.EducationID),									   SqlHelper.MakeInParam("@EarningID",System.Data.SqlDbType.Int,4,_c_UserDataInfo.EarningID),									   SqlHelper.MakeInParam("@Tel",System.Data.SqlDbType.VarChar,100,_c_UserDataInfo.Tel),									   SqlHelper.MakeInParam("@HowKnowID",System.Data.SqlDbType.Int,4,_c_UserDataInfo.HowKnowID),									   SqlHelper.MakeInParam("@IsOpen",System.Data.SqlDbType.Bit,1,_c_UserDataInfo.IsOpen),									   SqlHelper.MakeInParam("@QQ",System.Data.SqlDbType.Int,4,_c_UserDataInfo.QQ),									   SqlHelper.MakeInParam("@Msn",System.Data.SqlDbType.VarChar,100,_c_UserDataInfo.Msn),									   SqlHelper.MakeInParam("@Homepage",System.Data.SqlDbType.VarChar,100,_c_UserDataInfo.Homepage)								   };			return NonQueryBool("c_UserData_Create",prams);		}		#endregion

				#region c_ArticleInfo		public bool Create_c_ArticleInfo(c_ArticleInfo _c_ArticleInfo)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@PostDate",System.Data.SqlDbType.DateTime,8,_c_ArticleInfo.PostDate),									   SqlHelper.MakeInParam("@Title",System.Data.SqlDbType.NVarChar,100,_c_ArticleInfo.Title),									   SqlHelper.MakeInParam("@Content",System.Data.SqlDbType.NText,0,_c_ArticleInfo.Content),									   SqlHelper.MakeInParam("@ArticleType",System.Data.SqlDbType.Int,4,_c_ArticleInfo.ArticleType),									   SqlHelper.MakeInParam("@SortID",System.Data.SqlDbType.Int,4,_c_ArticleInfo.SortID),									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,_c_ArticleInfo.RegisterID)								   };			return NonQueryBool("c_Article_Create",prams);		}		public bool Update_c_ArticleInfo(c_ArticleInfo _c_ArticleInfo)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,_c_ArticleInfo.ID),									   SqlHelper.MakeInParam("@PostDate",System.Data.SqlDbType.DateTime,8,_c_ArticleInfo.PostDate),									   SqlHelper.MakeInParam("@Title",System.Data.SqlDbType.NVarChar,100,_c_ArticleInfo.Title),									   SqlHelper.MakeInParam("@Content",System.Data.SqlDbType.NText,0,_c_ArticleInfo.Content),									   SqlHelper.MakeInParam("@ArticleType",System.Data.SqlDbType.Int,4,_c_ArticleInfo.ArticleType),									   SqlHelper.MakeInParam("@SortID",System.Data.SqlDbType.Int,4,_c_ArticleInfo.SortID),									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,_c_ArticleInfo.RegisterID)								   };			return NonQueryBool("c_Article_Update",prams);		}		public bool Delete_c_ArticleByID(Int32 iD)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,iD)								   };			return NonQueryBool("c_Article_DeleteByID",prams);		}		public IDataReader Select_c_ArticleByID(Int32 iD)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,iD)								   };			return GetReader("c_Article_SelectInfoByID",prams);		}		#endregion

		#region c_PhotoInfo		public bool Create_c_PhotoInfo(c_PhotoInfo _c_PhotoInfo)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@PhotoName",System.Data.SqlDbType.VarChar,500,_c_PhotoInfo.PhotoName),									   SqlHelper.MakeInParam("@PhotoExplian",System.Data.SqlDbType.NVarChar,2000,_c_PhotoInfo.PhotoExplian),									   SqlHelper.MakeInParam("@PostDate",System.Data.SqlDbType.DateTime,8,_c_PhotoInfo.PostDate),									   SqlHelper.MakeInParam("@SortID",System.Data.SqlDbType.Int,4,_c_PhotoInfo.SortID),									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,_c_PhotoInfo.RegisterID),									   SqlHelper.MakeInParam("@IsUpLoad",System.Data.SqlDbType.Bit,1,_c_PhotoInfo.IsUpLoad),									   SqlHelper.MakeInParam("@PhotoType",System.Data.SqlDbType.Int,4,_c_PhotoInfo.PhotoType),									   SqlHelper.MakeInParam("@CircleID",System.Data.SqlDbType.Int,4,_c_PhotoInfo.CircleID),									   SqlHelper.MakeInParam("@ImageName",System.Data.SqlDbType.VarChar,500,_c_PhotoInfo.ImageName),									   SqlHelper.MakeInParam("@PhotoSize",System.Data.SqlDbType.Int,4,_c_PhotoInfo.PhotoSize)								   };			return NonQueryBool("c_Photo_Create",prams);		}		public bool Update_c_PhotoInfo(c_PhotoInfo _c_PhotoInfo)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,_c_PhotoInfo.ID),									   SqlHelper.MakeInParam("@PhotoName",System.Data.SqlDbType.VarChar,500,_c_PhotoInfo.PhotoName),									   SqlHelper.MakeInParam("@PhotoExplian",System.Data.SqlDbType.NVarChar,2000,_c_PhotoInfo.PhotoExplian),									   SqlHelper.MakeInParam("@PostDate",System.Data.SqlDbType.DateTime,8,_c_PhotoInfo.PostDate),									   SqlHelper.MakeInParam("@SortID",System.Data.SqlDbType.Int,4,_c_PhotoInfo.SortID),									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,_c_PhotoInfo.RegisterID),									   SqlHelper.MakeInParam("@IsUpLoad",System.Data.SqlDbType.Bit,1,_c_PhotoInfo.IsUpLoad),									   SqlHelper.MakeInParam("@PhotoType",System.Data.SqlDbType.Int,4,_c_PhotoInfo.PhotoType),									   SqlHelper.MakeInParam("@CircleID",System.Data.SqlDbType.Int,4,_c_PhotoInfo.CircleID),									   SqlHelper.MakeInParam("@ImageName",System.Data.SqlDbType.VarChar,500,_c_PhotoInfo.ImageName),									   SqlHelper.MakeInParam("@PhotoSize",System.Data.SqlDbType.Int,4,_c_PhotoInfo.PhotoSize)								   };			return NonQueryBool("c_Photo_Update",prams);		}				public bool Delete_c_PhotoByID(Int32 iD)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,iD)								   };			return NonQueryBool("c_Photo_DeleteByID",prams);		}		public IDataReader Select_c_PhotoByID(Int32 iD)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,iD)								   };			return GetReader("c_Photo_SelectInfoByID",prams);		}		#endregion

		#region c_MusicInfo		public bool Create_c_MusicInfo(c_MusicInfo _c_MusicInfo)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@PostDate",System.Data.SqlDbType.DateTime,8,_c_MusicInfo.PostDate),									   SqlHelper.MakeInParam("@MusicName",System.Data.SqlDbType.NVarChar,1000,_c_MusicInfo.MusicName),									   SqlHelper.MakeInParam("@MusicSize",System.Data.SqlDbType.Int,4,_c_MusicInfo.MusicSize),									   SqlHelper.MakeInParam("@Singer",System.Data.SqlDbType.NVarChar,200,_c_MusicInfo.Singer),									   SqlHelper.MakeInParam("@MusicUrl",System.Data.SqlDbType.VarChar,500,_c_MusicInfo.MusicUrl),									   SqlHelper.MakeInParam("@IsUpLoad",System.Data.SqlDbType.Bit,1,_c_MusicInfo.IsUpLoad),									   SqlHelper.MakeInParam("@Format",System.Data.SqlDbType.VarChar,50,_c_MusicInfo.Format),									   SqlHelper.MakeInParam("@Explain",System.Data.SqlDbType.NVarChar,4000,_c_MusicInfo.Explain),									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,_c_MusicInfo.RegisterID),									   SqlHelper.MakeInParam("@SortID",System.Data.SqlDbType.Int,4,_c_MusicInfo.SortID)								   };			return NonQueryBool("c_Music_Create",prams);		}		public bool Update_c_MusicInfo(c_MusicInfo _c_MusicInfo)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,_c_MusicInfo.ID),									   SqlHelper.MakeInParam("@PostDate",System.Data.SqlDbType.DateTime,8,_c_MusicInfo.PostDate),									   SqlHelper.MakeInParam("@MusicName",System.Data.SqlDbType.NVarChar,1000,_c_MusicInfo.MusicName),									   SqlHelper.MakeInParam("@MusicSize",System.Data.SqlDbType.Int,4,_c_MusicInfo.MusicSize),									   SqlHelper.MakeInParam("@Singer",System.Data.SqlDbType.NVarChar,200,_c_MusicInfo.Singer),									   SqlHelper.MakeInParam("@MusicUrl",System.Data.SqlDbType.VarChar,500,_c_MusicInfo.MusicUrl),									   SqlHelper.MakeInParam("@IsUpLoad",System.Data.SqlDbType.Bit,1,_c_MusicInfo.IsUpLoad),									   SqlHelper.MakeInParam("@Format",System.Data.SqlDbType.VarChar,50,_c_MusicInfo.Format),									   SqlHelper.MakeInParam("@Explain",System.Data.SqlDbType.NVarChar,4000,_c_MusicInfo.Explain),									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,_c_MusicInfo.RegisterID),									   SqlHelper.MakeInParam("@SortID",System.Data.SqlDbType.Int,4,_c_MusicInfo.SortID)								   };			return NonQueryBool("c_Music_Update",prams);		}		public bool Delete_c_MusicByID(Int32 iD)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,iD)								   };			return NonQueryBool("c_Music_DeleteByID",prams);		}		public IDataReader Select_c_MusicByID(Int32 iD)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,iD)								   };			return GetReader("c_Music_SelectInfoByID",prams);		}		#endregion

		#region c_UserDataCountInfo		public IDataReader GetUserCountInfo(Int32 registerID)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,registerID)								   };			return GetReader("GetUserCountInfo",prams);		}		#endregion

		#region c_GuestBookInfo		public bool Create_c_GuestBookInfo(c_GuestBookInfo _c_GuestBookInfo)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@NiceName",System.Data.SqlDbType.VarChar,100,_c_GuestBookInfo.NiceName),									   SqlHelper.MakeInParam("@Content",System.Data.SqlDbType.NVarChar,4000,_c_GuestBookInfo.Content),									   SqlHelper.MakeInParam("@RePost",System.Data.SqlDbType.NVarChar,4000,_c_GuestBookInfo.RePost),									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,_c_GuestBookInfo.RegisterID),									   SqlHelper.MakeInParam("@PostDate",System.Data.SqlDbType.DateTime,8,_c_GuestBookInfo.PostDate)								   };			return NonQueryBool("c_GuestBook_Create",prams);		}		public bool Update_c_GuestBookInfo(c_GuestBookInfo _c_GuestBookInfo)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,_c_GuestBookInfo.ID),									   SqlHelper.MakeInParam("@NiceName",System.Data.SqlDbType.VarChar,100,_c_GuestBookInfo.NiceName),									   SqlHelper.MakeInParam("@Content",System.Data.SqlDbType.NVarChar,4000,_c_GuestBookInfo.Content),									   SqlHelper.MakeInParam("@RePost",System.Data.SqlDbType.NVarChar,4000,_c_GuestBookInfo.RePost),									   SqlHelper.MakeInParam("@RegisterID",System.Data.SqlDbType.Int,4,_c_GuestBookInfo.RegisterID),									   SqlHelper.MakeInParam("@PostDate",System.Data.SqlDbType.DateTime,8,_c_GuestBookInfo.PostDate)								   };			return NonQueryBool("c_GuestBook_Update",prams);		}		public IDataReader Select_c_GuestBookByID(Int32 iD)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,iD)								   };			return GetReader("c_GuestBook_SelectInfoByID",prams);		}		public bool Delete_c_GuestBookByID(Int32 iD)		{			SqlParameter[] prams = {									   SqlHelper.MakeInParam("@ID",System.Data.SqlDbType.Int,4,iD)								   };			return NonQueryBool("c_GuestBook_DeleteByID",prams);		}		#endregion

		#region Helpers

		public DataSet GetDataSet(string sql, SqlParameter[] p)
		{
			return SqlHelper.ExecuteDataset(ConnectionString,CommandType.StoredProcedure,sql,p);
		}
		public DataSet GetDataSet(string sql)
		{
			return SqlHelper.ExecuteDataset(ConnectionString,CommandType.Text,sql);
		}
		public IDataReader GetReader(string sql, SqlParameter[] p)
		{
			return SqlHelper.ExecuteReader(ConnectionString,CommandType.StoredProcedure,sql,p);
		}
		public IDataReader GetReader(string sql)
		{
			return SqlHelper.ExecuteReader(ConnectionString,CommandType.Text,sql);
		}
		public int NonQueryInt(string sql, SqlParameter[] p)
		{
			return SqlHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure,sql,p);
		}
		public int NonQueryInt(string sql)
		{
			return SqlHelper.ExecuteNonQuery(ConnectionString,CommandType.Text,sql);
		}
		public bool NonQueryBool(string sql, SqlParameter[] p)
		{
			return NonQueryInt(sql,p) > 0;
		}
		public bool IsExist(string sql, SqlParameter[] p)
		{
			return ((int)SqlHelper.ExecuteScalar(ConnectionString,sql, p))>0;
		}
		public IDataReader SelectPageBySqlDataReader(string tableName,string getFields,string orderField,int pageSize,int pageIndex,bool orderType,string strWhere)
		{
			SqlParameter[] prams = {
									   SqlHelper.MakeInParam("@TableName",System.Data.SqlDbType.VarChar,255,tableName),
									   SqlHelper.MakeInParam("@GetFields",System.Data.SqlDbType.VarChar,2000,getFields),
									   SqlHelper.MakeInParam("@OrderField",System.Data.SqlDbType.VarChar,255,orderField),
									   SqlHelper.MakeInParam("@PageSize",System.Data.SqlDbType.Int,4,pageSize),
									   SqlHelper.MakeInParam("@PageIndex",System.Dat

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -