Saturday, October 15, 2011

Web service for news update using sql database

this code will generate XML file for the database entry which will useful to access in web application
steps:
Import following namespace
using System.Xml;
using System.Data.Sql;

[WebMethod]
    public XmlElement GetUserDetails(string str1)
    {
        con = new SqlConnection(ConfigurationManager.ConnectionStrings["NewsConnection"].ToString());
        con.Open();
        cmd = new SqlCommand("select * from NewsData where NewsCategory like @str1 + '%'", con);
       // dr = cmd.ExecuteReader();
       // cmd.Parameters.AddWithValue("@News", NewsHeadline);
        cmd.Parameters.AddWithValue("@str1", str1);
        cmd.ExecuteNonQuery();
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        // Create an instance of DataSet.
        DataSet ds = new DataSet();
        da.Fill(ds);
        con.Close();
        // Return the DataSet as an XmlElement.
        XmlDataDocument xmldata = new XmlDataDocument(ds);
        XmlElement xmlElement = xmldata.DocumentElement;
        return xmlElement;
    }
}

Monday, September 12, 2011

WEB PORTAL FOR FACULTY AND STUDENT RESEARCH WORK, BITS Goa.

•Design the web portal.
•Which contains faculty and student access.
•Contains information regarding faculty research work, paper presented and other curriculum detail.
Which helps student to decide their area of  research.
Any new information which you want to add in this portal, please comment.
This is my ongoing project in BITS Goa.