Click here to Skip to main content
15,888,077 members
Home / Discussions / C#
   

C#

 
AnswerRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Rob Philpott31-Dec-09 0:42
Rob Philpott31-Dec-09 0:42 
AnswerRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Keith Barrow31-Dec-09 0:46
professionalKeith Barrow31-Dec-09 0:46 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
sri_346431-Dec-09 0:52
sri_346431-Dec-09 0:52 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Keith Barrow31-Dec-09 1:09
professionalKeith Barrow31-Dec-09 1:09 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
sri_346431-Dec-09 3:24
sri_346431-Dec-09 3:24 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
0x3c031-Dec-09 2:25
0x3c031-Dec-09 2:25 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Thomas Krojer31-Dec-09 3:05
Thomas Krojer31-Dec-09 3:05 
Questionproblem with RSS feed - pubDate Pin
CrimeanTurtle200831-Dec-09 0:16
CrimeanTurtle200831-Dec-09 0:16 
Hi All,

Hope everyone had a Merry Xmas and Happy New Year.

Just a question...I have made an RSS Feed which is syndicated by the Mozilla and IE , as an output of an XML file. However when either of the feeds show, they show the pubDate as being totally different dates to what is shown in the XML file. Even when I look at the source, the XML file still shows the correct dates as opposed to what is shown in the browser.
What do you guys think is the problem? Heres my code. Cheers.


public static void CreateNewsFeed(string mappath)
{
FileStream fs = null;
StreamWriter sw = null;

try
{


using (SqlConnection conn = Connection.connect())
{


SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "ShowNewsFeed";
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader reader = cmd.ExecuteReader();

fs = new FileStream(mappath, System.IO.FileMode.Create, System.IO.FileAccess.Write);
sw = new StreamWriter(fs);

sw.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
//ISO-8859-1
//xmlns:atom=\"http://www.w3.org/2005/Atom\"

sw.WriteLine("<rss version=\"2.0\">");
sw.WriteLine("<channel>");
sw.WriteLine("<title>Company Name</title>");
sw.WriteLine("<link>http://www.companyname.com.au/Home/News/News.aspx</link>");
sw.WriteLine("<description>News and the latest updates</description>");
sw.WriteLine("<language>en-us</language>");


while (reader.Read())
{
DateTime dt = (DateTime)reader["datePosted"];

sw.WriteLine("<item>");
sw.WriteLine("<title>" + reader["title"].ToString() + "</title>");
sw.WriteLine("<link>http://www.companyname.com.au/NewsArticle.aspx?newsID=" + reader["newsID"] + "</link>");
sw.WriteLine("<description>" + reader["description"].ToString() + "</description>");
sw.WriteLine("<pubDate>" + dt.ToString("R") + "</pubDate>");
sw.WriteLine("</item>");

}

sw.WriteLine("</channel>");
sw.WriteLine("</rss>");
sw.Close();
fs.Close();

}
}
catch (Exception m)
{

throw new Exception(m.Message);
}

}
AnswerRe: problem with RSS feed - pubDate [modified] Pin
ProtoBytes31-Dec-09 3:48
ProtoBytes31-Dec-09 3:48 
QuestionInternet explorer HTTP Authentication - sending or storing headers Pin
Vijayanand Settin30-Dec-09 23:32
Vijayanand Settin30-Dec-09 23:32 
AnswerRe: Internet explorer HTTP Authentication - sending or storing headers Pin
Sipder31-Dec-09 1:40
Sipder31-Dec-09 1:40 
GeneralRe: Internet explorer HTTP Authentication - sending or storing headers Pin
Vijayanand Settin4-Jan-10 1:36
Vijayanand Settin4-Jan-10 1:36 
QuestionSpelling checker Pin
linatta30-Dec-09 23:00
linatta30-Dec-09 23:00 
AnswerRe: Spelling checker Pin
Ravi Bhavnani31-Dec-09 16:34
professionalRavi Bhavnani31-Dec-09 16:34 
GeneralRe: Spelling checker Pin
linatta31-Dec-09 21:02
linatta31-Dec-09 21:02 
Questionfacing problems with Dictonary object Pin
yadlaprasad30-Dec-09 22:34
yadlaprasad30-Dec-09 22:34 
AnswerRe: facing problems with Dictonary object Pin
Abhinav S30-Dec-09 22:56
Abhinav S30-Dec-09 22:56 
AnswerRe: facing problems with Dictonary object Pin
OriginalGriff31-Dec-09 1:36
mveOriginalGriff31-Dec-09 1:36 
Questiongraphic Pin
jartrini30-Dec-09 22:14
jartrini30-Dec-09 22:14 
QuestionFile Problem in VISTA Pin
Wamuti30-Dec-09 21:31
Wamuti30-Dec-09 21:31 
AnswerRe: File Problem in VISTA Pin
Rob Philpott30-Dec-09 21:45
Rob Philpott30-Dec-09 21:45 
GeneralRe: File Problem in VISTA Pin
Wamuti30-Dec-09 21:55
Wamuti30-Dec-09 21:55 
GeneralRe: File Problem in VISTA Pin
Rob Philpott30-Dec-09 22:01
Rob Philpott30-Dec-09 22:01 
GeneralRe: File Problem in VISTA Pin
Wamuti30-Dec-09 22:05
Wamuti30-Dec-09 22:05 
AnswerRe: File Problem in VISTA Pin
#realJSOP30-Dec-09 23:41
mve#realJSOP30-Dec-09 23:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.