|
If I'm coding an RSS reader in C#, what's the method by which I can tell whether or not this specific item in this feed is new or not? There are no ID tags in the Item XML element in the feed. How can I tell whether or not the user has already downloaded this item?
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
Most of the RSS feeds have a guid element (under the item tag). If it's not available, you're out of luck, you can probably make do with the value in the link tag.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I am trying to drill down a xml file having schema reference in c# .NET and while processing have added namespace using XmlNamespaceManager but it still gives error "Namespace Manager or XsltContext needed. This query has a prefix, variable,or user-defined function." Following is the code snippet
-----------------code snippet-----------------------------------------
XmlDocument objDoc = new XmlDocument();
XmlNode objRoot;
objDoc.Load("C:\\abc.xml");
XmlNamespaceManager objXmlNS = new XmlNamespaceManager(objDoc.NameTable);
objXmlNS.AddNamespace("xmlns:OrigoNS","http://www.origoservices.com");
objRoot=objDoc.DocumentElement;
string MsgID=objRoot.SelectSingleNode("//OrigoNS:message_id").InnerText
------------------- abc.xml ----------------------------------
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.origoservices.com" xsi:schemalocation="http://www.origoservices.com Origo_S_2_S_Valuation.xsd"><m_control><control_timestamp>2005-07-25T09:55:30<message_id>342C3E5F-xxx4-4073-Byyy-C543973AA296<retry_number>0<message_type>abc Valuation Request<message_version>v1.0<expected_response_type>synchronous<initiator_id>xyz<responder_id>abc<user_id>test
-----------------------------------------------------------------
Would appreciate your help if you have got any clue for this problem
Thanks
Share knowledge to enhance your learning
|
|
|
|
|
Hi Neel07,
The Problem is the line:
objXmlNS.AddNamespace("xmlns:OrigoNS","http://www.origoservices.com");
You register the namespace uri http://www.origoservices.com with the prefix xmlns:OrigoNS. But you request uses the prefix OrigoNS only.
Simple use following line:
objXmlNS.AddNamespace("OrigoNS","www.origoservices.com");
Good Luck!
Niedzi
PS:
If you use xml code in your message, please use the Symbols < and > of the formating line (above the smilies) for the angle brackets.
Or write simple < and > for < and >.
|
|
|
|
|
Thanks a lot
I have found the solution and you are right we should mention only "OrigoNS" as namespace prefix. Also it should call the 1st overloaded method of SelectSingleNode passing the XmlNamespaceManager object in the 2nd parameter.
Corrected code
XmlDocument objXmlDoc = new XmlDocument();
objXmlDoc.Load("C:\\abc.xml");
objRoot=objXmlDoc.DocumentElement;
XmlNamespaceManager objXmlNS = new XmlNamespaceManager(objXmlDoc.NameTable);
objXmlNS.AddNamespace("OrigoNS","http://www.origoservices.com");
XmlNode objRoot;
string MsgID=objRoot.SelectSingleNode("//OrigoNS:message_id",objXmlNS).InnerText;
Share knowledge to enhance your learning
|
|
|
|
|
I implemented article “Inserting relational data using DataSet and DataAdapter” from this link: http://www.codeproject.com/cs/database/relationaladonet.asp[^] In my code.
It has a perfect explanation; still I got stuck at one point.
Debugger shows when that when I’m at this stage:
static void CustDataAdapter_OnRowUpdate(object sender, OleDbRowUpdatedEventArgs e)
{
OleDbCommand custCmd = new OleDbCommand("SELECT @@IDENTITY", e.Command.Connection);
e.Row["CustID"] = custCmd.ExecuteScalar();
e.Row.AcceptChanges();
}
This method defines the OleDbRowUpdatedEventHandler event, which comes to solve the AutoNumber column issue.
I got a message box error:
Problem populating dataset Box: [System.NullReferenceException: Object reference not set to an instance of an object at (object sender, OleDbRowUpdatedEventArgs e) in [path to file name]
There is some more text below it, but this seems to be the main thing. Why do I get NullReferenceException? What did I missed?
sea#
|
|
|
|
|
Hi,
i have file containing JPEGs one after anothe in a single file, if i view that as single image first image is shown
can anybody tell me how to parse that file to view those images
i have size of each image stored as well.
thanks
|
|
|
|
|
Hi,
I want to have to different login sections. One section for customer login, and the other login for administrators. Customers should login at wwwroot/customer/login.aspx, and administrators should log in at wwwroot/admin/login.aspx. Is it possible to have this in the webconfig file, what I mean is, if the user tries to access a page in one of these two sections the he/she will be directed to the correct login section? Is the web config file the correct way to do? Will it be able to keep track if the user is logged in or not?
Where can I get decent articles to read about the webconfig file?
All help is appreciated!!
Thanks
|
|
|
|
|
My question to you is how are you going to find out if the user is an admin or a customer until the credentials are typed in. The routing may/should only happen after that.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
Can you please advise?
If you have any good artices to read on this please let me know.
|
|
|
|
|
In ASP.NET you can use three different types of authentication. Form being the most used one, I take it as you're after this. Try reading from here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconthecookieauthenticationprovider.asp
modified 17-Jul-19 21:02pm.
|
|
|
|
|
does anybody have a clue how i can display and manipulate this format. it should be supported, but i can't handle it. perhaps the reason is the size of 2880*2160 px. please help
|
|
|
|
|
Hi all,
I have a statusbar with 3 panels an want to change the forecolor of one of them. Is there a way to do that ?
Thanks
regards
Frank
|
|
|
|
|
|
hi,
how do i give a name to a dialog box? when i put MessageBox.Text it gives me an error n i cant run the program.. what shd i do?
thz
|
|
|
|
|
When you do MessageBox.Show, the first parameter is the text to display in the box, the second parameter can be a string that will display as the name. Is that what you are looking for?
|
|
|
|
|
Hi!
I´m trying to write some kind of media-management-software, where i have the name of the media and some other information to be stored in some kind of variable/database/etc...
What i want to do is to offer some kind of full-text-search, which provied searching over some (not all) fields of my information-set. It also should work quite fast and with regular expression, somkind like the search-function in iTunes oder MSHelp/Index, so that as soon as i start typing the RegExp the results matching to that pattern are displayed in a result-window.
I don´t care, in which way the data is stored permanently on my HD, because i would load the data on program-start into a C#-Datafield. But which one should i use to make this work?
Who could recommend me a method to do this?
Thanks
J.Holzer
|
|
|
|
|
I think you can use lightweight database like mysql. Its very fast. Check this out.
Live Life King Size
Alomgir Miah
|
|
|
|
|
Hello...
In my opinion to find the best method for this problem, you must resolve yourself some problems...
How much data you will be store (1000 or 100000 strings) ???
Do you need a permant data access or only sometimes ???
The main problem when you use mySQL is that your Application is absolutly addicated to them and you need licenses for commercial use.
I believe the best choice to store the data is xml when you not store 100000 of strings...
It's well structered, easy to parse, independent from any other libraries and completly implemented in the net framework...
|
|
|
|
|
That depends on so many things... Desktop/Web app? How much data? How many simultaneous users you expect? Do you expect significant grow of amount of data and users?
IMHO it is like XML < Access < MySQL < MSDE* < SQLServer. (ordered by amount of data/users)
Some time ago I answered question about Access/MSDE, search the forum, there is link to MSDN page about different scenarios for Access/MSDE/SQL Server.
*I put MSDE > mySQL because of easy upgrade to SQL Server
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
I plan a Desktop-App, that should work on it´s own without any external software. So all data-access-routines should be in my software/.net-framework.
I wonder if an sql-query is that fast. The results should be seen instantly, while typing the pattern i´m searching for...
|
|
|
|
|
Hi!
I want to Add/Update/Get one record at one time.
suppose i have userTable with
int userID
nvarchar username
nvarchar email
to add data to userTable which is better?
1. using DataRow and fill it with userID,username,email and pass it to DataAccessLayer
2.Create user Class (USEREN) and using USEREN userBObj and fill it with userID,username,email and pass it to DataAccessLayerDataAccessLayer
thanks.
|
|
|
|
|
I think DataTable can be considered as generic Business object. If the number of records you are dealing with is huge go for (2) else (1) is the better solution.
Please note when using DataTable the entire schema information is also filled when you do DataAdapter.Fill().
Hope this helps.
Live Life King Size
Alomgir Miah
|
|
|
|
|
|