本文整理汇总了C#中SqlDataSourceCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SqlDataSourceCommandEventArgs类的具体用法?C# SqlDataSourceCommandEventArgs怎么用?C# SqlDataSourceCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlDataSourceCommandEventArgs类属于命名空间,在下文中一共展示了SqlDataSourceCommandEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DSData_Updating
protected void DSData_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
if (Session["attach"] != null)
{
e.Command.Parameters["link"].Value = Session["attach"].ToString();
}
}
示例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);
}
}
}
示例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");
}
}
示例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;
}
}
示例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"]);
}
示例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;
}
}
示例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;
}
示例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);
}
示例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;
}
}
示例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";
}
}
示例11: DSData_Inserting
protected void DSData_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
e.Command.Parameters["picpath"].Value = Session["attach"].ToString();
}
示例12: sdsEliminarAjuste_Updating
protected void sdsEliminarAjuste_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
//utiles.debugClass.muestra(e.Command,Server.MapPath("log.txt"));
}
示例13: DSData_Inserting
protected void DSData_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
//e.Command.Parameters["dataid"].Value = MCcontact.GetNewID("alldata", "dataid");
}
示例14: DSData_Inserting
protected void DSData_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
e.Command.Parameters["UserID"].Value = MCTEFollowUp.GetNewID("FollowupUsers", "UserID");
}
示例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));
}