本文整理汇总了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]
}
示例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();
}
示例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();
}
}
示例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";
}
}
示例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;
}
示例6: WebControlParameterProxy
internal WebControlParameterProxy(Parameter parameter, ParameterCollection parameterCollection, EntityDataSource entityDataSource)
{
Debug.Assert(null != entityDataSource);
_parameter = parameter;
_collection = parameterCollection;
_entityDataSource = entityDataSource;
VerifyUniqueType(_parameter);
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例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;
}