473,698 Members | 2,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem saving data in RSS Reader

1 New Member
//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.Ch annel.Rows.Coun t;
foreach(rssData Set.ChannelRow currentChannel in rssDataSet.Chan nel.Rows)
{

System.Collecti ons.ArrayList result;
result = rssManager.proc essNewsFeed(cur rentChannel.URL );

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

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

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

string filterExpressio n = "Title= '" + title + "'";

//i hv temporarily removed filtering
//System.Data.Dat aRow[] filterdNewsItem s= rssDataSet.News Item.Select(fil terExpression);
//PROBLEM IS HERE...!!!
//i am getting filterdNewsItem s Dimensions=0

//if (filterdNewsIte ms.Length != 0)
//{
rssDataSet.News ItemRow newRow = rssDataSet.News Item.NewNewsIte mRow();

newRow.Title = currentNewsItem .Title;
newRow.Link = currentNewsItem .Link;
newRow.Descript ion = currentNewsItem .Description;
newRow.ChannelI D = currentChannel. ChannelID;
newRow.DateAcqu ired = DateTime.Now;
newRow.NewsItem ID = ++l;

//if(newRow != null)
rssDataSet.News Item.AddNewsIte mRow(newRow);
// }
}
}
//PROBLEM HERE ALSO....!!!!whe n 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 = newsItemTableAd apter.Update(rs sDataSet);
// based on rowsaffected update status label

}
Mar 30 '08 #1
0 984

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

Similar topics

2
6165
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 then appends the data to a dataset that is built in the Page_Load code in the if(!isPostBack) block. When I try to add a row in the button click event code I get an error saying that "Object reference not set to an instance of an object". I'm...
1
2268
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 StringBuilder object and should paste into Excel via Clipboard.SetDataObject. When it comes time to paste the StringBuilder object is empty. If I strip all database code out and place the code in another project it works fine. Any ideas? Thanks for...
6
519
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 binary, I used the current position in the file and another stream to read to the binary data. All text data is ended with a carriage return / line feed while the binary is actually an image file listed byte by byte. Preceding the binary data...
1
1478
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 (aspx)and save it to a database without first saving the file on to the harddisk. If anyone can point me in the right direction on where I can find out about this it would be greatly appreciated.
3
5106
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 the client can store it and also read from it. I am trying out with C# and ASP.NET. Server Side Web Method: -----------------------
0
315
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" which I would like to fill with data from XML file. It works fine but my data is not displayed in ListBox properly - instead, I got a list of "System.Data.DataRowView" string items. I'd rather have URLs I had read. Here's the code:
0
908
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 answers. I have an asp:ListBox ID="DotNETWWW" which I would like to fill with data from XML file. It works fine but my data is not displayed in ListBox properly - instead, I got a list of "System.Data.DataRowView" string items. I'd rather have...
31
4587
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 are more objects that match the first object that i grabbed. If they match then I put them in an array. I would like to remove each match from the arraylist as I find them to speed things up and so that they don't get checked again. If I try...
2
2328
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, thereby relying on the built in Xml Serialization rather than my own implementation, I get 3 as expected. BTW, this is a distilled example of the problem - I need to implement IXmlSerializable as I have to hook up some event handlers following...
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9027
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.