本文整理汇总了C#中SqlDataSourceCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SqlDataSourceCommandEventArgs类的具体用法?C# SqlDataSourceCommandEventArgs怎么用?C# SqlDataSourceCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlDataSourceCommandEventArgs类属于命名空间,在下文中一共展示了SqlDataSourceCommandEventArgs类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DSData_Updating
protected void DSData_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
if (Session["attach"] != null)
{
e.Command.Parameters["link"].Value = Session["attach"].ToString();
}
}
开发者ID:EgyFalseX,项目名称:WebSites,代码行数:7,代码来源:centerViewer.aspx.cs
示例2: AccessDataSource1_Deleting
protected void AccessDataSource1_Deleting(object sender, SqlDataSourceCommandEventArgs e)
{
// Delete the image files
// Get the image file name
string picture1FileName;
using (OleDbConnection connection = ExamplesHelper.GetNewOpenDbConnection())
{
using (OleDbCommand command = connection.CreateCommand())
{
command.CommandText = "SELECT [Picture1_FileName_thumbnail] FROM [Ex_A_507] WHERE [ID][email protected]";
command.Parameters.AddWithValue("@Id", e.Command.Parameters["Id"].Value);
picture1FileName = Convert.ToString(command.ExecuteScalar());
}
}
if (!string.IsNullOrEmpty(picture1FileName))
{
// Delete the main image
string picture1FilePath_main = System.IO.Path.Combine(Server.MapPath("~/repository/store/ex_A_507/picture1/main/"), picture1FileName);
if (System.IO.File.Exists(picture1FilePath_main))
{
System.IO.File.Delete(picture1FilePath_main);
}
// Delete the thumbnail
string picture1FilePath_thumbnail = System.IO.Path.Combine(Server.MapPath("~/repository/store/ex_A_507/picture1/thumbnail/"), picture1FileName);
if (System.IO.File.Exists(picture1FilePath_thumbnail))
{
System.IO.File.Delete(picture1FilePath_thumbnail);
}
}
}
开发者ID:Gordon-from-Blumberg,项目名称:Piczard.Examples,代码行数:33,代码来源:default.aspx.cs
示例3: OnInserting
public void OnInserting(Object source, SqlDataSourceCommandEventArgs eventArgs)
{
FileUpload fileUpload = (FileUpload) BulletinDataGrid.FindControl("bulletinPdf");
DateTime pubDate = (DateTime) eventArgs.Command.Parameters["@pubDate"].Value;
if (fileUpload != null && pubDate != null && fileUpload.PostedFile != null && fileUpload.PostedFile.ContentLength > 0)
{
String filename = System.IO.Path.GetFileName(fileUpload.PostedFile.FileName);
filename = pubDate.ToString("yyyy-MM-dd") + ".pdf";
String saveLocation = Server.MapPath("~\\bulletins") + "\\" + filename;
try
{
fileUpload.PostedFile.SaveAs(saveLocation);
status.InnerHtml = "Uploaded Succesfully";
status.Style.Add(HtmlTextWriterStyle.Color, "Red");
}
catch (Exception exception)
{
status.InnerHtml = "Error: " + exception;
status.Style.Add(HtmlTextWriterStyle.Color, "Red");
}
}
else
{
status.InnerHtml = "Please select a file to upload.";
status.Style.Add(HtmlTextWriterStyle.Color, "Red");
}
}
开发者ID:Letractively,项目名称:rpcwc,代码行数:28,代码来源:bulletin.aspx.cs
示例4: DSData_Updating
protected void DSData_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
if (Convert.ToBoolean(e.Command.Parameters["tsfeat"].Value) == false && Convert.ToBoolean(e.Command.Parameters["winner"].Value) == true)
{
GVEditor.JSProperties["cpShowPopup"] = "لا يمكن تحديد الفائز بدون تصفيات";
e.Cancel = true;
}
}
开发者ID:EgyFalseX,项目名称:WebSites,代码行数:8,代码来源:studentallEditor.aspx.cs
示例5: sourceEmployees_Updating
protected void sourceEmployees_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
e.Command.Parameters["@First"].Value = e.Command.Parameters["@FirstName"].Value;
e.Command.Parameters["@Last"].Value = e.Command.Parameters["@LastName"].Value;
e.Command.Parameters.Remove(e.Command.Parameters["@FirstName"]);
e.Command.Parameters.Remove(e.Command.Parameters["@LastName"]);
}
开发者ID:Helen1987,项目名称:edu,代码行数:8,代码来源:SqlDataSourceUpdateStoredProc.aspx.cs
示例6: OnClubMemberDataSourceModifying
protected void OnClubMemberDataSourceModifying(object sender, SqlDataSourceCommandEventArgs e)
{
if(DemoSettings.IsSiteMode) {
rpReadOnlyError.Controls.Add(new LiteralControl(DemoSettings.ReadOnlyErrorMessage));
rpReadOnlyError.Visible = true;
e.Cancel = true;
}
}
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:8,代码来源:DataBinding.aspx.cs
示例7: DSData_Inserting
protected void DSData_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
string NewID = string.Empty;
OleDbDataAdapter da = new OleDbDataAdapter(@"Select Max(servisetypeid) From servisetype", ConnectionStr("faservice.mdb"));
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count == 0)
NewID = "1";
else
NewID = (Convert.ToInt16(dt.Rows[0][0].ToString()) + 1).ToString();
e.Command.Parameters["servisetypeid"].Value = NewID;
}
开发者ID:EgyFalseX,项目名称:WebSites,代码行数:13,代码来源:ServiceEditor.ascx.cs
示例8: DataSourceBrokerList_Inserting
protected void DataSourceBrokerList_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
e.Command.Parameters.Clear();
foreach (SqlParameter p in InsertParameters) e.Command.Parameters.Add(p);
}
开发者ID:tmthang-bi,项目名称:BrokerManager,代码行数:5,代码来源:BrokerListModification.aspx.cs
示例9: dsSelectedCompany_Updating
protected void dsSelectedCompany_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
//check to see if the image is in session and if it is use it for pictureURL
if (Session["newImage"] != null)
{
//use uploaded image name
string imageName = Session["newImage"].ToString();
//add the value to the insert command (available thru event args)
e.Command.Parameters["@CompanyLogo"].Value = imageName;
//remove the image from session variable
Session["newImage"] = null;//removing the newImage from Session
}//end if
else
{
//if there was an image uploaded on this editing of the record
//then we used the same if as we did w inserting a record, but
//in this case while editing the record if you wind up in this else
//they have no uploaded a new image. We can assume they had a pictureURL
//value before.
//If we skip this step, then the "empty string" will be passed.
//So if we want to let them keep their old pic, we need to find
//that value and reset it.
//grab what is currently being used and re-use it
DataClassesDataContext ctx = new DataClassesDataContext();
string currentImage = (from co in ctx.JFCompanies
where co.CompanyID.ToString() ==
gvCompanies.SelectedValue.ToString()
select co.CompanyLogo).Single();
//assign back to the pictureURL
//@ calls on the parametes of the command. we are calling on the update command
e.Command.Parameters["@CompanyLogo"].Value = currentImage;
}
}
开发者ID:haglerca,项目名称:CareerFinder,代码行数:39,代码来源:CopyofCompanies.aspx.cs
示例10: dsSelectedCompany_Inserting
protected void dsSelectedCompany_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
//right before this really does get inserted, we need to make sure the
//appropriate pictureURL value is included.
//check to see if the image is in session and if it is use it for pictureURL
if (Session["newImage"] != null)
{
//use uploaded image name
string imageName = Session["newImage"].ToString();
//add the value to the insert command (available thru event args)
e.Command.Parameters["@CompanyLogo"].Value = imageName;
//remove the image from session variable
Session["newImage"] = null;//removing the newImage from Session
}
else
{
//use our noImage image
e.Command.Parameters["@CompanyLogo"].Value = "NoPhoto.jpg";
}
}
开发者ID:haglerca,项目名称:CareerFinder,代码行数:23,代码来源:CopyofCompanies.aspx.cs
示例11: DSData_Inserting
protected void DSData_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
e.Command.Parameters["picpath"].Value = Session["attach"].ToString();
}
开发者ID:EgyFalseX,项目名称:WebSites,代码行数:4,代码来源:tblpic.ascx.cs
示例12: sdsEliminarAjuste_Updating
protected void sdsEliminarAjuste_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
//utiles.debugClass.muestra(e.Command,Server.MapPath("log.txt"));
}
开发者ID:royriojas,项目名称:RGEN2,代码行数:4,代码来源:vEliminarCasoAjuste.aspx.cs
示例13: DSData_Inserting
protected void DSData_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
//e.Command.Parameters["dataid"].Value = MCcontact.GetNewID("alldata", "dataid");
}
开发者ID:EgyFalseX,项目名称:WebSites,代码行数:4,代码来源:alldata3Editor.aspx.cs
示例14: DSData_Inserting
protected void DSData_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
e.Command.Parameters["UserID"].Value = MCTEFollowUp.GetNewID("FollowupUsers", "UserID");
}
开发者ID:EgyFalseX,项目名称:WebSites,代码行数:4,代码来源:UserEditor.aspx.cs
示例15: customerSqlDataSource_Inserting
protected void customerSqlDataSource_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
//SqlParameter insertedKey = new SqlParameter("@PK_New", SqlDbType.Int);
//insertedKey.Direction = ParameterDirection.Output;
//e.Command.Parameters.Add(new SqlParameter("@PK_New", SqlDbType.Int));
}
开发者ID:housemeow,项目名称:LOHAS,代码行数:6,代码来源:customerCreate.aspx.cs
示例16: SqlDataSource1_Inserting1
protected void SqlDataSource1_Inserting1(object sender, SqlDataSourceCommandEventArgs e)
{
utiles.debugClass.muestra(e.Command,Server.MapPath("log2.txt"));
}
开发者ID:royriojas,项目名称:RGEN2,代码行数:4,代码来源:vListaClausulasComunes.aspx.cs
示例17: sdsDocumentosDeSolicitud_Updating
protected void sdsDocumentosDeSolicitud_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
utiles.debugClass.muestra(e.Command, Server.MapPath("documentos.txt"));
}
开发者ID:royriojas,项目名称:RGEN2,代码行数:4,代码来源:vSolicitudDatos.aspx.cs
示例18: sdsDocumentos_Inserting
protected void sdsDocumentos_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
//utiles.debugClass.muestra(e.Command,Server.MapPath("documentos.txt"));
}
开发者ID:royriojas,项目名称:RGEN2,代码行数:4,代码来源:vSolicitudDatos.aspx.cs
注:本文中的SqlDataSourceCommandEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论