.NETGURU
build error
Messages   Related Types
This message was discovered on microsoft.public.vsnet.debugging.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

homer (VIP)
I am new to .net. The new IDE gives me a lot of headache with the build
errors.
Where can I get additional help on these error?
For example, the following one seems easy to grasp, but I still have no clue
how to fix it. The sample I tried copy is in vb.net as: dr(i) =
dtOld.rows(y).items(i).tostring.

DataRow dr = dt.NewRow;

dr(i)=ds.Tables[0].Rows(y).Items(i).ToString;

'dr' denotes a 'variable' where a 'method' was expected

The task sounds so simpple. You want to assign value from one
dataset/datatable to another by looping through one field at a time. Either I
am supper stupid or the .net learning curve is close to 90 degree, hours has
passed without going nowhere.

Reply to this message...
 
    
John Phillips
The compiler is telling you that there's a function on the right side, and a
variable on the left. You need to change your line to:

dr(i)=ds.Tables[0].Rows(y).Items(i).ToString();

--
John Phillips
MVP - Windows SDK

"homer" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
homer (VIP)
John,

Thank you for your reply.

That is how I started out, and I got the same error on that syntax.

"John Phillips" wrote:

[Original message clipped]

Reply to this message...
 
    
homer (VIP)
On another forum, somebody pointed out that I should use [] instead of () on
the index. Because I am in C#.

dr[i]=ds.Tables[0].Rows[y].ItemArray[i].ToString();
instead of
dr(i)=ds.Tables[0].Rows(y).Items(i).ToString();

Notice, I have to subtitute Items with ItemArray because there is no Items.
I am not sure it will give me what I want.

Anyway, talking about clueless description, and helplessness on getting
help, to me, that is the reason I would not recommend migrating vb6 to dotnet.

"homer" wrote:

[Original message clipped]

Reply to this message...
 
 
System.Data.DataRow




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification