Posts

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";         ...

Retrieve (Get) data from Database using Web Mehthod in asp.net

Image
Retrieve (Get) data from Database using Web Mehthod in asp.net   pagename.aspx   pagename.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; using System.Data; using System.Data.SqlClient; using System.Web.Services; public partial class Multiplefileuploader : System.Web.UI.Page {     protected void Page_Load(object sender, EventArgs e)     {         if (!Page.IsPostBack)         {             Getselect_tbl();         }     }     protected void UploadMultipleFiles(object sender, EventArgs e)     {     }     [WebMethod]     public static List Getselect_tbl()     { ...

Connection with M S Excel using asp.net

Connection with M S Excel file (which is type (.xlsx)) (C#) asp.net  Connection :  OleDbConnection conn = new OleDbConnection ( @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\nitin\Desktop\db_sumit.xlsx;Extended Properties=Excel 12.0 Xml" );   Select Query :       private void ConnectionExcel()     {         OleDbDataAdapter adp = new OleDbDataAdapter ( "Select * from [Sheet1$]" , conn);         DataTable dt = new DataTable ();         adp.Fill(dt);         GridView2.DataSource = dt;         GridView2.DataBind();     } InsertQuery : private void Insertwithaccess()     {         int IsCount = 0;         string cmdquery = "Insert into [ Sheet...