Exemplo n.º 1
0
		protected virtual SqlDataSourceView CreateDataSourceView (string viewName)
		{
			SqlDataSourceView view = new SqlDataSourceView (this, viewName, this.Context);
			if (IsTrackingViewState)
				((IStateManager) view).TrackViewState ();
			return view;
		}
        protected virtual SqlDataSourceView CreateDataSourceView(string viewName)
        {
            SqlDataSourceView view = new SqlDataSourceView(this, viewName, this.Context);

            if (IsTrackingViewState)
            {
                ((IStateManager)view).TrackViewState();
            }
            return(view);
        }
Exemplo n.º 3
0
        public void Run(string empName)
        {
            string queryString = "SELECT * FROM Employee where Name = " + empName;

            System.Web.UI.WebControls.SqlDataSource     sqlData     = new System.Web.UI.WebControls.SqlDataSource();
            System.Web.UI.WebControls.SqlDataSourceView sqlDataView = new System.Web.UI.WebControls.SqlDataSourceView(sqlData, "View", HttpContext.Current);
            sqlData = new System.Web.UI.WebControls.SqlDataSource(connectionstring, queryString);
            sqlData = new System.Web.UI.WebControls.SqlDataSource(provider, connectionstring, queryString);
            sqlData = new System.Web.UI.WebControls.SqlDataSource(selectCommand: queryString, connectionString: connectionstring);
            sqlData = new System.Web.UI.WebControls.SqlDataSource(providerName: provider, selectCommand: queryString, connectionString: connectionstring);
            sqlDataView.SelectCommand = queryString;
            sqlDataView.UpdateCommand = queryString;
            sqlDataView.InsertCommand = queryString;
            sqlDataView.DeleteCommand = queryString;
        }
 private SqlDataSourceView GetView()
 {
     if (this._view == null)
     {
         this._view = this.CreateDataSourceView("DefaultView");
         if (this._cachedSelectCommand != null)
         {
             this._view.SelectCommand = this._cachedSelectCommand;
         }
         if (base.IsTrackingViewState)
         {
             ((IStateManager)this._view).TrackViewState();
         }
     }
     return(this._view);
 }
        /// <devdoc>
        /// Dynamically creates the default (and only) SqlDataSourceView on demand.
        /// </devdoc>
        private SqlDataSourceView GetView()
        {
            if (_view == null)
            {
                _view = CreateDataSourceView(DefaultViewName);
                if (_cachedSelectCommand != null)
                {
                    // If there was a cached select command from the constructor, set it
                    _view.SelectCommand = _cachedSelectCommand;
                }

                if (IsTrackingViewState)
                {
                    ((IStateManager)_view).TrackViewState();
                }
            }

            return(_view);
        }
Exemplo n.º 6
0
        /// <devdoc>
        /// Dynamically creates the default (and only) SqlDataSourceView on demand.
        /// </devdoc>
        private SqlDataSourceView GetView() {
            if (_view == null) {
                _view = CreateDataSourceView(DefaultViewName);
                if (_cachedSelectCommand != null) {
                    // If there was a cached select command from the constructor, set it
                    _view.SelectCommand = _cachedSelectCommand;
                }

                if (IsTrackingViewState) {
                    ((IStateManager)_view).TrackViewState();
                }
            }

            return _view;
        }
 private SqlDataSourceView GetView()
 {
     if (this._view == null)
     {
         this._view = this.CreateDataSourceView("DefaultView");
         if (this._cachedSelectCommand != null)
         {
             this._view.SelectCommand = this._cachedSelectCommand;
         }
         if (base.IsTrackingViewState)
         {
             ((IStateManager) this._view).TrackViewState();
         }
     }
     return this._view;
 }