亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sqlhelper.cs

?? C#數據庫類。
?? CS
?? 第 1 頁 / 共 5 頁
字號:
		/// </summary>
		/// <remarks>
		/// e.g.:  
		///  DataSet ds = ExecuteDataset(conn, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24));
		/// </remarks>
		/// <param name="connection">A valid SqlConnection</param>
		/// <param name="commandType">The CommandType (stored procedure, text, etc.)</param>
		/// <param name="commandText">The stored procedure name or T-SQL command</param>
		/// <param name="commandParameters">An array of SqlParamters used to execute the command</param>
		/// <returns>A dataset containing the resultset generated by the command</returns>
		public static DataSet ExecuteDataset(SqlConnection connection, CommandType commandType, string commandText, params SqlParameter[] commandParameters)
		{
			if( connection == null ) throw new ArgumentNullException( "connection" );

			// Create a command and prepare it for execution
			SqlCommand cmd = new SqlCommand();
			bool mustCloseConnection = false;
			PrepareCommand(cmd, connection, (SqlTransaction)null, commandType, commandText, commandParameters, out mustCloseConnection );
    			
			// Create the DataAdapter & DataSet
			using( SqlDataAdapter da = new SqlDataAdapter(cmd) )
			{
				DataSet ds = new DataSet();

				// Fill the DataSet using default values for DataTable names, etc
				da.Fill(ds);
				
				// Detach the SqlParameters from the command object, so they can be used again
				cmd.Parameters.Clear();

				if( mustCloseConnection )
					connection.Close();

				// Return the dataset
				return ds;
			}	
		}
		
		/// <summary>
		/// Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlConnection 
		/// using the provided parameter values.  This method will query the database to discover the parameters for the 
		/// stored procedure (the first time each stored procedure is called), and assign the values based on parameter order.
		/// </summary>
		/// <remarks>
		/// This method provides no access to output parameters or the stored procedure's return value parameter.
		/// 
		/// e.g.:  
		///  DataSet ds = ExecuteDataset(conn, "GetOrders", 24, 36);
		/// </remarks>
		/// <param name="connection">A valid SqlConnection</param>
		/// <param name="spName">The name of the stored procedure</param>
		/// <param name="parameterValues">An array of objects to be assigned as the input values of the stored procedure</param>
		/// <returns>A dataset containing the resultset generated by the command</returns>
		public static DataSet ExecuteDataset(SqlConnection connection, string spName, params object[] parameterValues)
		{
			if( connection == null ) throw new ArgumentNullException( "connection" );
			if( spName == null || spName.Length == 0 ) throw new ArgumentNullException( "spName" );

			// If we receive parameter values, we need to figure out where they go
			if ((parameterValues != null) && (parameterValues.Length > 0)) 
			{
				// Pull the parameters for this stored procedure from the parameter cache (or discover them & populate the cache)
				SqlParameter[] commandParameters = SqlHelperParameterCache.GetSpParameterSet(connection, spName);

				// Assign the provided values to these parameters based on parameter order
				AssignParameterValues(commandParameters, parameterValues);

				// Call the overload that takes an array of SqlParameters
				return ExecuteDataset(connection, CommandType.StoredProcedure, spName, commandParameters);
			}
			else 
			{
				// Otherwise we can just call the SP without params
				return ExecuteDataset(connection, CommandType.StoredProcedure, spName);
			}
		}

		/// <summary>
		/// Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlTransaction. 
		/// </summary>
		/// <remarks>
		/// e.g.:  
		///  DataSet ds = ExecuteDataset(trans, CommandType.StoredProcedure, "GetOrders");
		/// </remarks>
		/// <param name="transaction">A valid SqlTransaction</param>
		/// <param name="commandType">The CommandType (stored procedure, text, etc.)</param>
		/// <param name="commandText">The stored procedure name or T-SQL command</param>
		/// <returns>A dataset containing the resultset generated by the command</returns>
		public static DataSet ExecuteDataset(SqlTransaction transaction, CommandType commandType, string commandText)
		{
			// Pass through the call providing null for the set of SqlParameters
			return ExecuteDataset(transaction, commandType, commandText, (SqlParameter[])null);
		}
		
		/// <summary>
		/// Execute a SqlCommand (that returns a resultset) against the specified SqlTransaction
		/// using the provided parameters.
		/// </summary>
		/// <remarks>
		/// e.g.:  
		///  DataSet ds = ExecuteDataset(trans, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24));
		/// </remarks>
		/// <param name="transaction">A valid SqlTransaction</param>
		/// <param name="commandType">The CommandType (stored procedure, text, etc.)</param>
		/// <param name="commandText">The stored procedure name or T-SQL command</param>
		/// <param name="commandParameters">An array of SqlParamters used to execute the command</param>
		/// <returns>A dataset containing the resultset generated by the command</returns>
		public static DataSet ExecuteDataset(SqlTransaction transaction, CommandType commandType, string commandText, params SqlParameter[] commandParameters)
		{
			if( transaction == null ) throw new ArgumentNullException( "transaction" );
			if( transaction != null && transaction.Connection == null ) throw new ArgumentException( "The transaction was rollbacked or commited, please provide an open transaction.", "transaction" );

			// Create a command and prepare it for execution
			SqlCommand cmd = new SqlCommand();
			bool mustCloseConnection = false;
			PrepareCommand(cmd, transaction.Connection, transaction, commandType, commandText, commandParameters, out mustCloseConnection );
    			
			// Create the DataAdapter & DataSet
			using( SqlDataAdapter da = new SqlDataAdapter(cmd) )
			{
				DataSet ds = new DataSet();

				// Fill the DataSet using default values for DataTable names, etc
				da.Fill(ds);
    			
				// Detach the SqlParameters from the command object, so they can be used again
				cmd.Parameters.Clear();

				// Return the dataset
				return ds;
			}	
		}
		
		/// <summary>
		/// Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified 
		/// SqlTransaction using the provided parameter values.  This method will query the database to discover the parameters for the 
		/// stored procedure (the first time each stored procedure is called), and assign the values based on parameter order.
		/// </summary>
		/// <remarks>
		/// This method provides no access to output parameters or the stored procedure's return value parameter.
		/// 
		/// e.g.:  
		///  DataSet ds = ExecuteDataset(trans, "GetOrders", 24, 36);
		/// </remarks>
		/// <param name="transaction">A valid SqlTransaction</param>
		/// <param name="spName">The name of the stored procedure</param>
		/// <param name="parameterValues">An array of objects to be assigned as the input values of the stored procedure</param>
		/// <returns>A dataset containing the resultset generated by the command</returns>
		public static DataSet ExecuteDataset(SqlTransaction transaction, string spName, params object[] parameterValues)
		{
			if( transaction == null ) throw new ArgumentNullException( "transaction" );
			if( transaction != null && transaction.Connection == null ) throw new ArgumentException( "The transaction was rollbacked or commited, please provide an open transaction.", "transaction" );
			if( spName == null || spName.Length == 0 ) throw new ArgumentNullException( "spName" );
			
			// If we receive parameter values, we need to figure out where they go
			if ((parameterValues != null) && (parameterValues.Length > 0)) 
			{
				// Pull the parameters for this stored procedure from the parameter cache (or discover them & populate the cache)
				SqlParameter[] commandParameters = SqlHelperParameterCache.GetSpParameterSet(transaction.Connection, spName);

				// Assign the provided values to these parameters based on parameter order
				AssignParameterValues(commandParameters, parameterValues);

				// Call the overload that takes an array of SqlParameters
				return ExecuteDataset(transaction, CommandType.StoredProcedure, spName, commandParameters);
			}
			else 
			{
				// Otherwise we can just call the SP without params
				return ExecuteDataset(transaction, CommandType.StoredProcedure, spName);
			}
		}

        #endregion ExecuteDataset
		
        #region ExecuteReader

		/// <summary>
		/// This enum is used to indicate whether the connection was provided by the caller, or created by SqlHelper, so that
		/// we can set the appropriate CommandBehavior when calling ExecuteReader()
		/// </summary>
		private enum SqlConnectionOwnership	
		{
			/// <summary>Connection is owned and managed by SqlHelper</summary>
			Internal, 
			/// <summary>Connection is owned and managed by the caller</summary>
			External
		}

		/// <summary>
		/// Create and prepare a SqlCommand, and call ExecuteReader with the appropriate CommandBehavior.
		/// </summary>
		/// <remarks>
		/// If we created and opened the connection, we want the connection to be closed when the DataReader is closed.
		/// 
		/// If the caller provided the connection, we want to leave it to them to manage.
		/// </remarks>
		/// <param name="connection">A valid SqlConnection, on which to execute this command</param>
		/// <param name="transaction">A valid SqlTransaction, or 'null'</param>
		/// <param name="commandType">The CommandType (stored procedure, text, etc.)</param>
		/// <param name="commandText">The stored procedure name or T-SQL command</param>
		/// <param name="commandParameters">An array of SqlParameters to be associated with the command or 'null' if no parameters are required</param>
		/// <param name="connectionOwnership">Indicates whether the connection parameter was provided by the caller, or created by SqlHelper</param>
		/// <returns>SqlDataReader containing the results of the command</returns>
		private static SqlDataReader ExecuteReader(SqlConnection connection, SqlTransaction transaction, CommandType commandType, string commandText, SqlParameter[] commandParameters, SqlConnectionOwnership connectionOwnership)
		{	
			if( connection == null ) throw new ArgumentNullException( "connection" );

			bool mustCloseConnection = false;
			// Create a command and prepare it for execution
			SqlCommand cmd = new SqlCommand();
			try
			{
				PrepareCommand(cmd, connection, transaction, commandType, commandText, commandParameters, out mustCloseConnection );
			
				// Create a reader
				SqlDataReader dataReader;

				// Call ExecuteReader with the appropriate CommandBehavior
				if (connectionOwnership == SqlConnectionOwnership.External)
				{
					dataReader = cmd.ExecuteReader();
				}
				else
				{
					dataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
				}
			
				// Detach the SqlParameters from the command object, so they can be used again.
				// HACK: There is a problem here, the output parameter values are fletched 
				// when the reader is closed, so if the parameters are detached from the command
				// then the SqlReader can磘 set its values. 
				// When this happen, the parameters can磘 be used again in other command.
				bool canClear = true;
				foreach(SqlParameter commandParameter in cmd.Parameters)
				{
					if (commandParameter.Direction != ParameterDirection.Input)
						canClear = false;
				}
            
				if (canClear)
				{
					cmd.Parameters.Clear();
				}

				return dataReader;
			}
			catch
			{
				if( mustCloseConnection )
					connection.Close();
				throw;
			}
		}

		/// <summary>
		/// Execute a SqlCommand (that returns a resultset and takes no parameters) against the database specified in 
		/// the connection string. 
		/// </summary>
		/// <remarks>
		/// e.g.:  
		///  SqlDataReader dr = ExecuteReader(connString, CommandType.StoredProcedure, "GetOrders");
		/// </remarks>
		/// <param name="connectionString">A valid connection string for a SqlConnection</param>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜久久久久久久久电影网| 日本精品一级二级| 99精品国产视频| 欧洲激情一区二区| 日韩精品中文字幕在线一区| 国产日韩成人精品| 亚洲成人精品在线观看| 国产在线看一区| 一本色道久久综合精品竹菊| 欧美精品在线一区二区| 久久久激情视频| 亚洲伦理在线精品| 青青草成人在线观看| 成人精品国产一区二区4080| 在线观看日韩高清av| 久久久电影一区二区三区| 亚洲精品视频在线观看免费 | www.欧美亚洲| 欧美日韩国产综合一区二区三区| 国产午夜亚洲精品不卡| 亚洲视频免费看| 久久99久久久久久久久久久| 99久久婷婷国产综合精品| 欧美一二区视频| 亚洲婷婷综合久久一本伊一区 | 日韩西西人体444www| 国产视频不卡一区| 婷婷综合另类小说色区| 成人一级片网址| 91精品国产综合久久精品性色| 国产亚洲污的网站| 三级成人在线视频| 一本色道久久综合亚洲aⅴ蜜桃| 精品国产伦一区二区三区观看体验| 亚洲视频一区二区在线观看| 国产一区二区三区综合| 欧美日韩美女一区二区| 亚洲欧洲国产专区| 国产一区二区三区精品视频| 欧美日韩精品是欧美日韩精品| 欧美激情艳妇裸体舞| 久久国产婷婷国产香蕉| 欧美视频一区二区三区| 中文字幕一区二区三区不卡| 国内偷窥港台综合视频在线播放| 欧美喷水一区二区| 亚洲最新视频在线观看| 不卡大黄网站免费看| 久久综合成人精品亚洲另类欧美 | 欧美肥妇bbw| 综合久久久久久| 国产福利91精品一区二区三区| 日韩美一区二区三区| 午夜伊人狠狠久久| 色老汉一区二区三区| 国产精品国产成人国产三级| 国产精品一卡二| 久久久久久久av麻豆果冻| 老司机精品视频在线| 制服丝袜国产精品| 午夜精彩视频在线观看不卡| 日本福利一区二区| 亚洲一区二区三区四区的| 91美女在线观看| 亚洲三级免费电影| 91浏览器在线视频| 亚洲激情五月婷婷| 色天使色偷偷av一区二区| 亚洲精品一卡二卡| 色一区在线观看| 一区二区成人在线视频| 色婷婷香蕉在线一区二区| 艳妇臀荡乳欲伦亚洲一区| 在线精品视频一区二区三四| 亚洲国产精品一区二区尤物区| 欧美在线免费观看亚洲| 亚洲免费观看高清完整版在线观看熊| 91看片淫黄大片一级在线观看| 亚洲黄色免费网站| 欧美亚洲禁片免费| 日本不卡一二三| 日韩女优av电影| 国产精品一区二区三区乱码| 国产精品每日更新| 色综合天天综合给合国产| 樱花影视一区二区| 9191国产精品| 久久99久久久欧美国产| 国产欧美视频一区二区三区| 99麻豆久久久国产精品免费优播| 亚洲女性喷水在线观看一区| 欧美三片在线视频观看| 婷婷国产v国产偷v亚洲高清| 精品久久久久久最新网址| 国产经典欧美精品| 亚洲另类春色校园小说| 欧美日韩国产一区| 精品亚洲成a人| 欧美国产精品专区| 欧美中文字幕久久| 日本vs亚洲vs韩国一区三区| 国产午夜亚洲精品羞羞网站| 91蜜桃免费观看视频| 日韩精品成人一区二区在线| 精品国产91九色蝌蚪| 成人激情免费视频| 亚洲一区日韩精品中文字幕| 日韩欧美国产综合在线一区二区三区| 国产一区二区h| 亚洲日本在线a| 7777精品伊人久久久大香线蕉的| 国产一区二区三区高清播放| 亚洲视频一区在线| 欧美一级理论片| 国产成人8x视频一区二区| 亚洲三级在线播放| 欧美电视剧在线观看完整版| 99国产精品视频免费观看| 日本成人在线不卡视频| 欧美高清在线精品一区| 欧美日韩一区二区电影| 国产精品中文字幕日韩精品| 亚洲综合一二三区| www欧美成人18+| 欧美影院一区二区| 国产精品资源在线看| 亚洲国产视频一区| 国产亚洲欧美激情| 欧美日韩的一区二区| 懂色av中文字幕一区二区三区| 五月天精品一区二区三区| 久久精品亚洲麻豆av一区二区| 欧美吞精做爰啪啪高潮| 国产乱人伦精品一区二区在线观看| 亚洲欧美另类在线| 久久久久久亚洲综合| 欧美日韩在线播放一区| 国产91精品精华液一区二区三区| 亚洲成人av电影| 亚洲欧美自拍偷拍色图| 欧美精品一区二区三区蜜桃| 欧美性淫爽ww久久久久无| 成人激情免费网站| 狠狠色伊人亚洲综合成人| 一区二区国产视频| 国产欧美日韩另类视频免费观看| 91精品国产综合久久精品性色| 94色蜜桃网一区二区三区| 国产原创一区二区| 日韩电影在线一区| 亚洲一区二区三区四区五区黄| 欧美国产激情一区二区三区蜜月| 欧美一级欧美三级| 欧美三级电影网| 97se狠狠狠综合亚洲狠狠| 国产成人午夜99999| 久久99精品一区二区三区 | 欧美精品久久天天躁| 91色|porny| 99热精品一区二区| 国产成人午夜精品影院观看视频 | 久久久久久久久久久久电影| 欧美一区二区成人| 欧美影院一区二区三区| 91日韩精品一区| 成人av动漫在线| 成人中文字幕电影| 国产一区二区不卡老阿姨| 九色综合国产一区二区三区| 午夜精品123| 亚洲不卡一区二区三区| 一区二区三区在线视频观看| 一区二区中文视频| 国产精品美女久久久久久久久 | 成人性生交大合| 国产精品中文有码| 国产一区二区网址| 国产又黄又大久久| 精品一区精品二区高清| 久久se精品一区二区| 麻豆精品国产传媒mv男同| 麻豆国产一区二区| 狠狠色综合播放一区二区| 精品无人码麻豆乱码1区2区| 日韩成人免费电影| 日韩精品乱码免费| 男女男精品视频网| 久久超碰97中文字幕| 久草在线在线精品观看| 国内精品伊人久久久久av影院| 精品一区二区三区蜜桃| 久久精品国产精品亚洲精品| 久久精品国产网站| 国产馆精品极品| 91亚洲国产成人精品一区二三| gogo大胆日本视频一区| 91丝袜美腿高跟国产极品老师| 日本高清成人免费播放| 欧美网站一区二区| 日韩一区二区电影在线|