Error in Data fetch from csv file : General Questions

Error in Data fetch from csv file

Ask general questions here.

Error in Data fetch from csv file

Postby smigup » Mon Nov 30, 2009 2:04 pm

Hi,

Some issue with teh below code snippet.. I believe "DataRow" is not a defined object in the Library, can you suggest which object can I use to retrieve rows from my csv file ?

Thanks,
Smita

Code: Select all
CSVConnector csvConnector = new CSVConnector(@"..\..\CV.csv");
               
foreach( DataRow row in csvConnector.Rows)



Error Message with above
======================
The type or namespace name 'DataRow' could not be found (are you missing a using directive or an assembly reference?) (CS0246) - C:\Automation\..\Program.cs:43,16
smigup
 
Posts: 13
Joined: Mon Nov 30, 2009 10:49 am

Re: Error in Data fetch from csv file

Postby smigup » Mon Nov 30, 2009 2:14 pm

Once I qualify with System.Data, it works.
Thanks, Smita
smigup
 
Posts: 13
Joined: Mon Nov 30, 2009 10:49 am

Build Error ..

Postby smigup » Wed Dec 02, 2009 8:46 am

Hi,

Getting following error while compiling. Can someone guide me where to look for this duplicate ?

Thanks
Smita

The item "Part.UserCode.cs" was specified more than once in the "Sources" parameter. Duplicate items are not supported by the "Sources" parameter. (MSB3105)
smigup
 
Posts: 13
Joined: Mon Nov 30, 2009 10:49 am

Re: Error in Data fetch from csv file

Postby Support Team » Wed Dec 02, 2009 6:20 pm

It seems you have two files called "Part.UserCode.cs" in your project. You have to rename one of them in order to make the project build again.

Did you accidently move/copy the "Part.UserCode.cs" file from a recording named "Part" to somewhere else in the project?

Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4289
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Error in Data fetch from csv file

Postby SanMan » Wed Apr 14, 2010 11:02 am

I have this same problem when trying to compile modified Data Driven Test:

The type or namespace name 'DataRow' could not be found (are you missing a using directive or an assembly reference?) (CS0246)

What could be wrong? I am newbe and practicing the features...


Solved: I was missing:
using System.Data;

Don't know why?
SanMan
 
Posts: 49
Joined: Tue Apr 13, 2010 10:59 am

Re: Error in Data fetch from csv file

Postby Support Team » Wed Apr 14, 2010 1:26 pm

The .NET Framework is structured by namespaces. DataRow is a class in the .NET Framework and resides in the System.Data namespace. Therefore you have to either always qualify the class name with the full namespace (i.e. System.Data.DataRow) or add a "using System.Data;" statement at the beginning of the code file.

For further information see the corresponding MSDN documentation:
http://msdn.microsoft.com/library/z2kcy19k.aspx

Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4289
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to General Questions

Who is online

Users browsing this forum: No registered users and 1 guest