You must Sign In to post a response.
  • Category: .NET

    I want answers for these basic programs

    Hi frnds,

    I want answers for these below programs

    1.Read comma delimited file from folder and insert data into database?
    2.Asp.Net Application with multiple theme support and user should be able to change/switch the theme at runtime?
    3.A sample authentication & authorization application?
    4.Read data from DB and write the data into XML document
  • #762952

    Hello Sai Krishna,

    We can not answer all of your questions here. You can google it for sample application of authentication & authorization.

    2--> Themes

    // Get the theme name from a QueryString variable
    string ThemeName;
    ThemeName = Request.QueryString["thename"];
    if (ThemeName != null)
    Page.Theme = ThemeName;

    4--> XML

    <html xmlns="" >
    <head runat="server">
    <form id="form1" runat="server">
    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Width="1000px" Height="500px"></asp:TextBox>

    Code - behind :

    using System.Data;
    using System.Data.SqlClient;
    using System.Xml;

    SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Database1.mdf;Integrated Security=True;User Instance=True");
    protected void Page_Load(object sender, EventArgs e)

    SqlCommand cmd = new SqlCommand("SELECT * FROM Employees", con);
    SqlDataReader dr = cmd.ExecuteReader();
    string strXML = "<EMPLOYEES>" + Environment.NewLine + Environment.NewLine;
    while (dr.Read())
    strXML += "<EMPLOYEE>" + Environment.NewLine +
    "<ID>" + dr[0].ToString() + "</ID>" + Environment.NewLine +
    "<NAME>" + dr[1].ToString() + "</NAME>" + Environment.NewLine +
    "<DESIGNATION>" + dr[2].ToString() + "</DESIGNATION>" + Environment.NewLine +
    "<EMAIL>" + dr[3].ToString() + "</EMAIL>" + Environment.NewLine +
    "</EMPLOYEE>" + Environment.NewLine + Environment.NewLine;
    strXML += "</EMPLOYEES>";

    XmlDocument xDoc = new XmlDocument();

    TextBox1.Text = strXML;
    catch(Exception ex)

    See the attached image. It's an output i have got using above mentioned code.

    Hope this will help you.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

    Delete Attachment

  • #762953

    Am unable link the mytheme.css to theme name in code behind.
    mytheme.css contains changing backgroundcolor of form to red.


    Sai Krishna Reddy.

  • #762954

    Yes I agree with Nirav, this is totally your Home work.
    There are 2 categories 1) Forum 2) Articles.

    1) Forum : In this section we will discuss about the error details and any minor corrections as requested by member.

    2) Article : In this section we will give more explanation about the topic.

    As per your question, it is not related to Forum section, we can't give you answer in simple words. First you need to Google it all the questions, and gather some information and make simple program, if you have any doubt in that or you may struck in any place then raise that with error details. If you want more on that Go through the Article section, there most of our experts post no of article which may be helpful to you in better way.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #762955
    Hello Sai Krishna,

    Theme doesn't mean css file. Theme is too much different from css file in ASP.NET

    Themes in ASP.NET :
    You should create .skin file in ASP.NET to apply it on controls.

    Default skin template. The following skins are provided as examples only.

    1. Named control skin. The SkinId should be uniquely defined because
    duplicate SkinId's per control type are not allowed in the same theme.

    <asp:GridView runat="server" SkinId="gridviewSkin" BackColor="White" >
    <AlternatingRowStyle BackColor="Blue" />

    2. Default skin. The SkinId is not defined. Only one default
    control skin per control type is allowed in the same theme.

    <asp:Image runat="server" ImageUrl="~/images/image1.jpg" />
    <asp:Label runat="server" Backcolor="#ff9999"/>
    <asp:Button runat="server" Forecolor="Blue"/>
    <asp:TextBox runat="server" Font-Size="small" Backcolor="#66ccff"/>

    <asp:TextBox runat="server" Font-Size="large" Backcolor="#ff9966" SkinID="t"/>

    If you are defining SkinID="t" than wherever you will use SkinID in textbox only on those textboxes it will be applied. Where in other control it will applied on all controls if you are adding theme in your page.

    More Reference :

    Hope it will help you.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #762958

    Hi Saikrishna.

    Authentication modes in are Windows, forms and passport.
    Authentication is like checking whether he is allowed user or not.
    Authorization is like checking whether the user has rights to access particular resource.
    < authentication mode="Windows"/>
    <location path="Admin.aspx">
    <allow roles="Administrator"/>
    <deny users="*"/>
    </ authorization >

    Sridhar Thota.
    Editor: DNS Forum.

Sign In to post your comments