473,320 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

problem saving data in RSS Reader

1
//here i hv to filter newsitems which i already hv in my database
// and save the rest. BUT i am getting some errors
// PLZ HELP


private void queryChannels()
{
int l=rssDataSet.Channel.Rows.Count;
foreach(rssDataSet.ChannelRow currentChannel in rssDataSet.Channel.Rows)
{

System.Collections.ArrayList result;
result = rssManager.processNewsFeed(currentChannel.URL);

foreach (RSSReader2.NewsItem currentNewsItem in result)
{
string title = currentNewsItem.Title;

if (title.Length >= 50)
title = title.Substring(0, 49);

title.Replace("'", "");

string filterExpression = "Title= '" + title + "'";

//i hv temporarily removed filtering
//System.Data.DataRow[] filterdNewsItems= rssDataSet.NewsItem.Select(filterExpression);
//PROBLEM IS HERE...!!!
//i am getting filterdNewsItems Dimensions=0

//if (filterdNewsItems.Length != 0)
//{
rssDataSet.NewsItemRow newRow = rssDataSet.NewsItem.NewNewsItemRow();

newRow.Title = currentNewsItem.Title;
newRow.Link = currentNewsItem.Link;
newRow.Description = currentNewsItem.Description;
newRow.ChannelID = currentChannel.ChannelID;
newRow.DateAcquired = DateTime.Now;
newRow.NewsItemID = ++l;

//if(newRow != null)
rssDataSet.NewsItem.AddNewsItemRow(newRow);
// }
}
}
//PROBLEM HERE ALSO....!!!!when i removed the filtering
//ERROR IS :Cannot insert explicit value for identity column
// in table 'NewsItem' when IDENTITY_INSERT is set to OFF
.
int rowsAffected = newsItemTableAdapter.Update(rssDataSet);
// based on rowsaffected update status label

}
Mar 30 '08 #1
0 966

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and...
1
by: kevininstructor | last post by:
I found code on the web which takes data from an MS-Access table (my test table has three rows by five fields) copies it to the Clipboard then into a range within MS-Excel. Data is stored in a...
6
by: | last post by:
I am rewriting a C++ application in C#. This file has a combination of Text and Binary data. I used CFile before to read the text. If I hit a certain string that denotes the following data is...
1
by: rohith | last post by:
Hope someone can help with this question. I have a digital camera that will be used to capture photographs for picture ids. My question is whether I can capture the image from a web page...
3
by: Ipsita | last post by:
Hi! I am trying SOAP with DIME attachments in web services. For example say, I have a file resume.pdf stored somewhere on my server. How does the web service send the file to the client, so that...
0
by: R.A.M. | last post by:
Hello, (sorry for my English...) Please help me with a problem of DataView definition for DataTable (DefaultView doesn't work). I have little experience. I have an asp:ListBox ID="DotNETWWW"...
0
by: R.A.M. | last post by:
Hello, Please help me with a problem of DataView definition for DataTable (DefaultView doesn't work). I have little experience. I present the problem here second time, because I haven't got any...
31
by: Extremest | last post by:
I have a loop that is set to run as long as the arraylist is > 0. at the beginning of this loop I grab the first object and then remove it. I then go into another loop that checks to see if there...
2
by: OllieHag | last post by:
Hi, can anyone help me out with this problem? In the code posted below, why does my count of Data objects only return 1, not 3. If I comment out the IXmlSerializable inheritance in the Data class,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.