protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection("Data Source=Aarambh;Initial Catalog=rebuild_technology;Integrated Security=True"); con.Open(); SqlCommand cmd = new SqlCommand("select * from content_managment ", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); foreach (DataRow dr in ds.Tables[0].Rows) { Session["divhtml_heading1"] = dr["divhtml_content"].ToString(); } }
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Home" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <% Response.Write(Session["divhtml_heading1"].ToString()); %> </asp:Content>
Session["divhtml_heading1"]=""; foreach (DataRow dr in ds.Tables[0].Rows) { Session["divhtml_heading1"] = Session["divhtml_heading1"] +"<br>" + dr["divhtml_content"].ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)