Tuesday, August 13, 2013

datalist itemcommand for cancel c#




protected void datalist_id_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName.ToString() == "cancel")
        {

            datalist_id.EditItemIndex = -1;

            DataSet ds = my_db.sqlpuldata("select * from tbl_url order by url_id desc");
            datalist_id.DataSource = ds;
            datalist_id.DataBind();
        }

Monday, January 19, 2009

UltraExpandableGroupBox

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Infragistics.Win;

namespace UltraGroupBox_CS
{
public class StackedGroupsForm : System.Windows.Forms.Form
{
private Infragistics.Win.Misc.UltraExpandableGroupBox ultraExpandableGroupBox1;
private Infragistics.Win.Misc.UltraExpandableGroupBoxPanel ultraExpandableGroupBoxPanel1;
private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1;
private Infragistics.Win.Misc.UltraExpandableGroupBox ultraExpandableGroupBox5;

#region Wizard Stuff



public StackedGroupsForm()
{
InitializeComponent();
}



#region Windows Form Designer generated code

private void InitializeComponent()
{
this.ultraExpandableGroupBox1 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
this.ultraExpandableGroupBoxPanel1 = new Infragistics.Win.Misc.UltraExpandableGroupBoxPanel();
this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox();
this.ultraExpandableGroupBox5 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
this.ultraExpandableGroupBox1.SuspendLayout();
this.ultraExpandableGroupBoxPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox5)).BeginInit();
this.ultraExpandableGroupBox5.SuspendLayout();
this.SuspendLayout();
//
// ultraExpandableGroupBox1
//
this.ultraExpandableGroupBox1.Controls.Add(this.ultraExpandableGroupBoxPanel1);
this.ultraExpandableGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
//
// ultraExpandableGroupBoxPanel1
//
this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraGroupBox1);
this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraExpandableGroupBox5);
this.ultraExpandableGroupBoxPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
//
// ultraGroupBox1
//
this.ultraGroupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ultraGroupBox1.Location = new System.Drawing.Point(0, 24);
this.ultraGroupBox1.Name = "ultraGroupBox1";
this.ultraGroupBox1.Text = "&Advanced";
this.ultraGroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003;
//
// ultraExpandableGroupBox5
//
this.ultraExpandableGroupBox5.Dock = System.Windows.Forms.DockStyle.Top;
this.ultraExpandableGroupBox5.Expanded = false;
this.ultraExpandableGroupBox5.ExpandedSize = new System.Drawing.Size(634, 104);
this.ultraExpandableGroupBox5.ExpansionIndicator = Infragistics.Win.Misc.GroupBoxExpansionIndicator.Far;
this.ultraExpandableGroupBox5.HeaderClickAction = Infragistics.Win.Misc.GroupBoxHeaderClickAction.ToggleExpansion;
this.ultraExpandableGroupBox5.Location = new System.Drawing.Point(0, 0);
this.ultraExpandableGroupBox5.Name = "ultraExpandableGroupBox5";
this.ultraExpandableGroupBox5.Size = new System.Drawing.Size(634, 24);
this.ultraExpandableGroupBox5.Text = "&Basic";
this.ultraExpandableGroupBox5.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003;
//

// StackedGroupsForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(640, 224);
this.Controls.Add(this.ultraExpandableGroupBox1);
this.Name = "StackedGroupsForm";
this.Text = "Stacked Groups";
this.Load += new System.EventHandler(this.StackedGroupsForm_Load);

((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).EndInit();
this.ultraExpandableGroupBox1.ResumeLayout(false);
this.ultraExpandableGroupBoxPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox5)).EndInit();
this.ultraExpandableGroupBox5.ResumeLayout(false);
this.ResumeLayout(false);


}
#endregion

private void StackedGroupsForm_Load(object sender, EventArgs e)
{

}



#endregion // Wizard Stuff
}
}

connection string with web.config

string connectionString = ConfigurationManager.ConnectionStrings["azeem12"].ConnectionString;


SqlConnection con = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand("insert into tbl (name)values ('ee') ", con);
{
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}