當前位置: 首頁>>代碼示例>>C#>>正文


C# WebControls.Parameter類代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.Parameter的典型用法代碼示例。如果您正苦於以下問題:C# Parameter類的具體用法?C# Parameter怎麽用?C# Parameter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Parameter類屬於System.Web.UI.WebControls命名空間,在下文中一共展示了Parameter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LoadFilteredDRDetails

        public void LoadFilteredDRDetails(SqlDataSource DRDetailsDataSource, int DRID_S, int DRID_E, int CustomerNumber)
        {
            StringBuilder search_command = new StringBuilder();
            search_command.Append(" SELECT DR.DRNo, DRDtl.SKU, DRDtl.StyleNo, DR.ItemStatus, DRDtl.Quantity, DRDtl.UnitPrice FROM DR INNER JOIN DRDtl ON DR.ID = DRDtl.DRID ");
            search_command.Append(" where DR.ID between @ID_S and @ID_E and custno [email protected]_Number ");
            Parameter prmDRIDS = new Parameter
            {
                 DbType = System.Data.DbType.Int32 ,
                 Name = "ID_S",
                  DefaultValue = DRID_S.ToString(),
            };

            Parameter prmDRIDE = new Parameter
            {
                DbType = System.Data.DbType.Int32,
                Name = "ID_E",
                DefaultValue = DRID_E.ToString(),
            };
            Parameter prmCustomerNumber = new Parameter
            {
                DbType = System.Data.DbType.Int32,
                Name = "Customer_Number",
                DefaultValue = CustomerNumber.ToString(),
            };
            DRDetailsDataSource.SelectParameters.Add(prmDRIDS);
            DRDetailsDataSource.SelectParameters.Add(prmDRIDE);
            DRDetailsDataSource.SelectParameters.Add(prmCustomerNumber);
            DRDetailsDataSource.SelectCommand = search_command.ToString();
            DRDetailsDataSource.DataBind();
            //       SELECT DR.DRNo, DRDtl.SKU, DRDtl.StyleNo, DR.ItemStatus, DRDtl.Quantity, DRDtl.UnitPrice FROM DR
            //INNER JOIN DRDtl ON DR.ID = DRDtl.DRID
            //where DR.ID between @IDS and @IDE and custno [email protected]
        }
開發者ID:DennisPitallano,項目名稱:IRMS-MARKETING,代碼行數:33,代碼來源:DeliveryReceiptsManager.cs

示例2: Index

        //
        // GET: /SSQL/
        public ActionResult Index()
        {
            //REPORTEREntities1 db = new REPORTEREntities1();
            //db.Connection.ConnectionString.Select(db.jobs);
            //SqlDataSource ss = new SqlDataSource();
            ////SqlDataSource1

            //string connectionString = WebConfigurationManager.ConnectionStrings["jobs"].ConnectionString;
            //SqlConnection con = new SqlConnection(connectionString);
            //    //con.DataSource(SqlDataSource1);

            //string sql = "create table test3(id int identity(1,1) primary key, SecondField varchar(10))";
            //SqlCommand cmd = new SqlCommand(sql, con);
            //con.Open();
            //cmd.ExecuteNonQuery();
            //con.Close();

            //Data Source=.\sqlexpress;Initial Catalog=REPORTER;Integrated Security=True;Pooling=False

             //SELECT dbo.jobs.Date, dbo.jobtype.JTitle, dbo.UsersRP.Login, SUM(dbo.jobs.Jtimeh) AS SumTime1, dbo.jobs.Jname
             //FROM dbo.jobs
             //INNER JOIN dbo.jobtype ON dbo.jobs.Jtid = dbo.jobtype.Jid
             //INNER JOIN dbo.UsersRP ON dbo.jobs.Uid = dbo.UsersRP.Id
             //GROUP BY dbo.jobs.Date, dbo.jobtype.JTitle, dbo.UsersRP.Login, dbo.jobs.Jname)

               System.Web.UI.WebControls.Parameter pp = new System.Web.UI.WebControls.Parameter();
               //string sss;

               //pp.Name = "Login";
               //pp.DefaultValue = sss;
               //System.Web.UI.ControlsSqlDataSource3.SelectParameters.Add(pp);

            return View();
        }
開發者ID:wpride88,項目名稱:Reporter,代碼行數:36,代碼來源:SSQLController.cs

示例3: Show

 internal static void Show(GridView ListTests, string UserName)
 {
     SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString);
     string str = "select d.Discipline_name, c.categories_name, t.name, ct.points, ct.dateComplite " +
         " from Complite_test as ct inner join test as t on ct.test_id = t.test_id " +
         " inner join Categories as c on c.cat_id = t.cat_id " +
         " inner join discipline as d on d.discipline_id = c.discipline_id " +
         " inner join users as u on u.user_id = ct.user_id where u.login = @login";
     SqlCommand cmd = new SqlCommand(str, con);
     cmd.Parameters.AddWithValue("login", UserName);
     try
     {
         con.Open();
         SqlDataSource ds = new SqlDataSource(con.ConnectionString, str);
         Parameter p = new Parameter("login", System.Data.DbType.String, UserName);
         ds.SelectParameters.Add(p);
         ListTests.DataSource = ds;
         ListTests.DataBind();
     }
     catch (Exception)
     {
         throw new ApplicationException("Не удается отобразить список завершенных тестов");
     }
     finally {
         con.Close();
     }
 }
開發者ID:juchok,項目名稱:testKnowlige,代碼行數:27,代碼來源:testComplite.aspx.cs

示例4: Page_Load

        void Page_Load(object sender, EventArgs e)
        {
            if (Page.User.IsInRole("ProjectAdministrator"))
            {
                ProjectData.SortParameterName = "sortParameter";
                ProjectData.SelectMethod = "GetAllProjects";
            }
            else
            {

                bool wasFound = false;
                foreach (Parameter parameter in ProjectData.SelectParameters)
                {
                    if (parameter.Name == "userName")
                        wasFound = true;
                }
                if (!wasFound)
                {
                    Parameter param = new Parameter("userName", TypeCode.String, Page.User.Identity.Name);
                    ProjectData.SelectParameters.Add(param);
                }
                ProjectData.SortParameterName = "sortParameter";
                ProjectData.SelectMethod = "GetProjectsByManagerUserName";
            }
        }
開發者ID:vivekananth,項目名稱:AzureTimeTracker,代碼行數:25,代碼來源:Project_List.aspx.cs

示例5: Parameter

		protected Parameter (Parameter original)
		{
			this.DefaultValue = original.DefaultValue;
			this.Direction = original.Direction;
			this.ConvertEmptyStringToNull = original.ConvertEmptyStringToNull;
			this.Type = original.Type;
			this.Name = original.Name;
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:8,代碼來源:Parameter.cs

示例6: WebControlParameterProxy

 internal WebControlParameterProxy(Parameter parameter, ParameterCollection parameterCollection, EntityDataSource entityDataSource)
 {
     Debug.Assert(null != entityDataSource);
     _parameter = parameter;
     _collection = parameterCollection;
     _entityDataSource = entityDataSource;
     VerifyUniqueType(_parameter);
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:WebControlParameterProxy.cs

示例7: CreateParameter

 private static Parameter CreateParameter(string name, string value, MetaColumn configurationColumn) {
     var param = new Parameter() {
         Name = name,
         DefaultValue = value
     };
     DataSourceUtil.SetParameterTypeCodeAndDbType(param, configurationColumn);
     return param;
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:RouteParametersHelper.cs

示例8: SetParameterTypeCodeAndDbType

 internal static void SetParameterTypeCodeAndDbType(Parameter parameter, MetaColumn column) {
     // If it's a Guid, use a DbType, since TypeCode doesn't support it.  For everything else, use TypeCode
     if (column.ColumnType == typeof(Guid)) {
         parameter.DbType = DbType.Guid;
     }
     else {
         parameter.Type = column.TypeCode;
     }
 }
開發者ID:krytht,項目名稱:DotNetReferenceSource,代碼行數:9,代碼來源:DataSourceUtil.cs

示例9: SqlDataSourceFilterClause

 public SqlDataSourceFilterClause(DesignerDataConnection designerDataConnection, DesignerDataTableBase designerDataTable, System.ComponentModel.Design.Data.DesignerDataColumn designerDataColumn, string operatorFormat, bool isBinary, string value, System.Web.UI.WebControls.Parameter parameter)
 {
     this._designerDataConnection = designerDataConnection;
     this._designerDataTable = designerDataTable;
     this._designerDataColumn = designerDataColumn;
     this._isBinary = isBinary;
     this._operatorFormat = operatorFormat;
     this._value = value;
     this._parameter = parameter;
 }
開發者ID:Reegenerator,項目名稱:Sample-CustomizeDatasetCS,代碼行數:10,代碼來源:SqlDataSourceFilterClause.cs

示例10: Parameter

		protected Parameter (Parameter original)
		{
			if (original == null)
				throw new NullReferenceException (".NET emulation");
			
			this.DefaultValue = original.DefaultValue;
			this.Direction = original.Direction;
			this.ConvertEmptyStringToNull = original.ConvertEmptyStringToNull;
			this.Type = original.Type;
			this.Name = original.Name;
		}
開發者ID:nobled,項目名稱:mono,代碼行數:11,代碼來源:Parameter.cs

示例11: GridView1_OnRowUpdating

 protected void GridView1_OnRowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     GridViewRow gr = this.GridView1.Rows[e.RowIndex] as GridViewRow;
     FileUpload MyFileUpload = gr.Cells[1].FindControl("FileUpload2") as FileUpload;
     TextBox MyTextBox1 = gr.Cells[1].FindControl("Textbox6") as TextBox;
     TextBox MyTextBox2 = gr.Cells[2].FindControl("Textbox5") as TextBox;
     TextBox MyTextBox3 = gr.Cells[1].FindControl("Textbox8") as TextBox;
     TextBox MyTextBox4 = gr.Cells[1].FindControl("Textbox7") as TextBox;
     if (MyFileUpload.HasFile)
     {
         string PicPath = HttpContext.Current.Server.MapPath("~/images/PictureGallery/Staff/Temp/" + MyFileUpload.FileName);
         MyFileUpload.SaveAs(PicPath);
         IconReSizeImage(PicPath, MyFileUpload.FileName);
         string OldImagePath = Session["ImageUrl"].ToString();
         try
         {
             System.IO.File.Delete(HttpContext.Current.Server.MapPath(OldImagePath));
         }
         catch
         {
         }
         string PhotoPath = "~/images/PictureGallery/Staff/" + MyFileUpload.FileName;
         AccessDataSource1.UpdateParameters.Add("MemberName", MyTextBox1.Text);
         AccessDataSource1.UpdateParameters.Add("MemberDescription", MyTextBox2.Text);
         AccessDataSource1.UpdateParameters.Add("Order", MyTextBox3.Text);
         AccessDataSource1.UpdateParameters.Add("MemberTitle", MyTextBox4.Text);
         AccessDataSource1.UpdateParameters.Add("MemberPhotoPath", PhotoPath);
         Parameter DataRowKey = new Parameter("ID");
         DataRowKey.DefaultValue = e.Keys[0].ToString();
         AccessDataSource1.UpdateParameters.Add(DataRowKey);
         AccessDataSource1.Update();
         GridView1.EditIndex = -1;
         GridView1.DataBind();
     }
     else
     {
         string PhotoPath = Session["ImageUrl"].ToString();
         AccessDataSource1.UpdateParameters.Add("MemberName", MyTextBox1.Text);
         AccessDataSource1.UpdateParameters.Add("MemberDescription", MyTextBox2.Text);
         AccessDataSource1.UpdateParameters.Add("Order", MyTextBox3.Text);
         AccessDataSource1.UpdateParameters.Add("MemberTitle", MyTextBox4.Text);
         Parameter MemberPhotoPath = new Parameter("MemberPhotoPath");
         MemberPhotoPath.DefaultValue = PhotoPath;
         AccessDataSource1.UpdateParameters.Add(MemberPhotoPath);
         Parameter DataRowKey = new Parameter("ID");
         DataRowKey.DefaultValue = e.Keys[0].ToString();
         AccessDataSource1.UpdateParameters.Add(DataRowKey);
         AccessDataSource1.Update();
         GridView1.EditIndex = -1;
         GridView1.DataBind();
     }
 }
開發者ID:tstanley93,項目名稱:ARC.ORG-trunk,代碼行數:52,代碼來源:Staff_Update_Tool.aspx.cs

示例12: BuildCommand

 private void BuildCommand(IConfigurationElement parametersSection, ParameterCollection parameters)
 {
     parameters.Clear();
     foreach (IConfigurationElement parameterElement in parametersSection.Elements.Values)
     {
         Parameter commandParameter = new Parameter();
         foreach (IConfigurationElement propertyElement in parameterElement.Elements.Values)
         {
             ReflectionServices.SetValue(commandParameter, propertyElement.GetAttributeReference("name").Value.ToString(), propertyElement.GetAttributeReference("value").Value);
         }
         parameters.Add(commandParameter);
     }
 }
開發者ID:t1b1c,項目名稱:lwas,代碼行數:13,代碼來源:SqlDataSourceConfigurationParser.cs

示例13: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            start = new Parameter("start", DbType.Date);
            end = new Parameter("end", DbType.Date);

            if (!IsPostBack)
            {
                dsVehicles.SelectParameters.Add(start);
                dsVehicles.SelectParameters.Add(end);

                startDate.SelectedDate = DateTime.Today;
                endDate.SelectedDate = DateTime.Today.AddDays(1);
            }
        }
開發者ID:diblaze,項目名稱:Prog_2,代碼行數:14,代碼來源:Bookings.aspx.cs

示例14: OnInit

		protected override void OnInit(EventArgs e)
		{
			base.OnInit(e);

			this.Selecting += new ObjectDataSourceSelectingEventHandler(DeluxeObjectDataSource_Selecting);
			this.Selected += new ObjectDataSourceStatusEventHandler(DeluxeObjectDataSource_Selected);

			if (this.SelectParameters["where"] == null)
			{
				Parameter whereParameter = new Parameter("where", DbType.String, string.Empty);

				whereParameter.Direction = ParameterDirection.Input;

				this.SelectParameters.Add(new Parameter("where", DbType.String, string.Empty));
			}
		}
開發者ID:jerryshi2007,項目名稱:AK47Source,代碼行數:16,代碼來源:DeluxeObjectDataSource.cs

示例15: ObjectDataSourceEx

        public ObjectDataSourceEx()
        {
            this.EnablePaging = true;
            this.SelectMethod = "SelectAll";
            this.SelectCountMethod = "SelectAllCount";
            this.SortParameterName = "sortExpression";

            this.UpdateMethod = "Update";
            this.DeleteMethod = "Delete";

            var filterParameter = new Parameter {Name = "filterExpression", DefaultValue = string.Empty};
            this.SelectParameters.Add(filterParameter);

            this.Selecting += this.ObjectDataSourceEx_Selecting;
            this.Selected += this.ObjectDataSourceEx_Selected;
        }
開發者ID:arul141890,項目名稱:ScriptGenerator,代碼行數:16,代碼來源:ObjectDataSourceEx.cs


注:本文中的System.Web.UI.WebControls.Parameter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。