Posts

Alert Message using C#

Alert Message Using C# in ASP.NET  --------------------- Method 1 ScriptManager .RegisterClientScriptBlock( this , this .GetType(), "alertMessage" , "alert('Your Selected AccountID is : " + AccountID + "')" , true ); -------------------- Method 2 ClientScript.RegisterStartupScript ( this .GetType(), "alert" , "alert('Insert is successfull')" , true ); 

Calculate Simple Interest

Calculate Simple Intersert  Calculate Simple Interest in Sql Server 2008 DECLARE @P float ; DECLARE @R float ; DECLARE @T float ; DECLARE @SI float ;     set @P = 50000 ;     set @R = 05;     set @T = 05;     set @SI = @P*@R*@T/100     select @SI as 'Simple Interest'   Calculate Compound Interest select @P* POWER ((1+@R/100),@T)-@P as 'compoundInterest'  
Image
WRITE ON GOOGLE CHROME LIKE NOTEPAD PASTE THIS URL IN CHROME BROWSER : AND WRITE LIKE NOTE PADE ;)
Remove HTML Tages from Datatable In C# First Create This Function.  Public string RemoveHTMLTags( string source)  {         return Regex .Replace(source, "<.*?>", string .Empty);  } And Then use like this ---------------------------- // Data Stored in DataTable if (dt.Rows.Count > 0) { string strterm = Convert .ToString(dt.Rows[0]["term"].ToString()); strterm = RemoveHTMLTags(strterm); } else { }

Page authentication on web pages

Page authentication in web pages Web.config : < system.web >      < compilation debug = " true " targetFramework = " 4.0 " />              < authentication mode = " Forms " >      < forms loginUrl = " Default.aspx " name = " login " timeout = " 120 " ></ forms >      </ authentication >          < authorization >           < deny users = " ? " />      </ authorization >         </ system.web > Login.aspx : protected void btnLogin_Click( object sender, EventArgs e)     {         SqlConnection con = new SqlConnection ( ConfigurationManager .ConnectionStrings[ "dbconnection" ...

Tree view in winforms using c#

Image
Tree view in c# ms sqlserver 2008(database) __________________________ step 1 _________ CREATE TABLE [dbo].[myTable]( [ID] [int] IDENTITY(1,1) NOT NULL, [title] [varchar](255) NOT NULL, [parentID] [int] NULL,  CONSTRAINT [PK_myTable] PRIMARY KEY CLUSTERED  ( [ID] ASC )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] ) ON [PRIMARY] step 2 _________ INSERT INTO myTable(title, parentID) VALUES('Microsoft', NULL) INSERT INTO myTable( title, parentID) VALUES('C#', 1) INSERT INTO myTable( title, parentID) VALUES('VB.net', 1) INSERT INTO myTable( title, parentID) VALUES('Open Source', NULL) INSERT INTO myTable( title, parentID) VALUES('Python', 4) INSERT INTO myTable( title, parentID) VALUES('Ruby', 4) INSERT INTO myTable( title, parentID) VALUES('PHP', 4) INSERT INTO myTable( title, parentID) VALUES('Perl...

How to bind xml data with combobox using c#

Image
how to bind xml data with combobox using c# =================== START ===================  XMLFile1.xml =================== ====================================== Form1.cs =================== private void Form1_Load(object sender, EventArgs e)         {             DataBind();         } private void DataBind()         {             XmlTextReader Objxml = new XmlTextReader("C:\\Users\\nitin\\Documents\\Visual Studio 2010\\Projects\\WindowsFormsApplication1\\WindowsFormsApplication1\\XMLFile1.xml");             DataSet objdataset = new DataSet();             objdataset.ReadXml(Objxml);             comboBox1.DataSource = objdataset.Tables[0];             comboBox1.DisplayMember = "Name";         ...