473,757 Members | 6,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Confused beginner

I am doing the first walk through on the Visual Studio .Net walkthrough book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1 .Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(a uthors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1 .Update(authorC hanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~
Nov 17 '05 #1
12 1889

"Blaze" <Bl***@discussi ons.microsoft.c om> wrote in message
news:EF******** *************** ***********@mic rosoft.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

What errors are you getting when you build?
Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1 .Fill(authors);
return authors;
}
This looks a bit fuzzy.

(case sensative remember). Try this:

public Authors1 GetAuthors()

and

Authors1 authors = new Authors1();

(or the other way, depending on how the Authors1 class is named)

[WebMethod]
public authors1 UpdateAuthors(a uthors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1 .Update(authorC hanges);
returen authorChanges;
}
else
return null;
}
}
I'm guessing on this one (based on the above):

public Authors1 UpdateAuthors(A uthors1 authorChanges)


I tired to put this a couple of different places, but it always fails?

Thanks in advance!~

Nov 17 '05 #2
"Blaze" <Bl***@discussi ons.microsoft.c om> wrote in message
news:EF******** *************** ***********@mic rosoft.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1 .Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(a uthors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1 .Update(authorC hanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~


Are you putting these method decarations inside a class declaration?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Nov 17 '05 #3


"Chance Hopkins" wrote:

"Blaze" <Bl***@discussi ons.microsoft.c om> wrote in message
news:EF******** *************** ***********@mic rosoft.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

What errors are you getting when you build?


*****
c:\inetpub\wwwr oot\AuthorsWebS ervice\AuthorsS ervice.asmx.cs( 138): Expected
class, delegate, enum, interface, or struct
c:\inetpub\wwwr oot\AuthorsWebS ervice\AuthorsS ervice.asmx.cs( 148): Expected
class, delegate, enum, interface, or struct
c:\inetpub\wwwr oot\AuthorsWebS ervice\AuthorsS ervice.asmx.cs( 159): Type or
namespace definition, or end-of-file expected
*****
Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1 .Fill(authors);
return authors;
}


This looks a bit fuzzy.

(case sensative remember). Try this:

public Authors1 GetAuthors()

and

Authors1 authors = new Authors1();

(or the other way, depending on how the Authors1 class is named)

[WebMethod]
public authors1 UpdateAuthors(a uthors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1 .Update(authorC hanges);
returen authorChanges;
}
else
return null;
}
}


I'm guessing on this one (based on the above):

public Authors1 UpdateAuthors(A uthors1 authorChanges)


I tired to put this a couple of different places, but it always fails?

Thanks in advance!~



Also, do you have to declare a comment before you start something new like
this?

blaze
Nov 17 '05 #4


"Richard Blewett [DevelopMentor]" wrote:
"Blaze" <Bl***@discussi ons.microsoft.c om> wrote in message
news:EF******** *************** ***********@mic rosoft.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1 .Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(a uthors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1 .Update(authorC hanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~


Are you putting these method decarations inside a class declaration?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk


I think the answer to that is:

I am putting it inside the AuthorsService. asmx.cs file? Sorry I just
ordered some beginner books on C#, just can't believe the walkthrough fails?

I have also tried this with a VB project with more failures. I would rather
learn C# if I'm going to learn something!

Thanks again!
Nov 17 '05 #5
Dude, you're just starting to learn programming, and you begin by trying to
write a Web Service? that could have something to do with it. You might want
to start with a simple "hello world" console app.

A book about Visual Studio.Net presupposes that one has some experience with
programming. Get yourself a beginning-level programming book, and work your
way up from there. You really don't want to present yourself with too many
challenges at first; you'll get frustrated and quit!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Blaze" <Bl***@discussi ons.microsoft.c om> wrote in message
news:EF******** *************** ***********@mic rosoft.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1 .Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(a uthors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1 .Update(authorC hanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~

Nov 17 '05 #6
I have 2 books on the way. I know a TON about web services and how to use
them and the way XML interacts with apps. I am a very experienced network
engineer with a pretty good grasp on technology. I just don't know how to
program, but am learning by myself. Do you have a suggested reading on the
"hello world" console app?

Thanks!

Blaze

"Kevin Spencer" wrote:
Dude, you're just starting to learn programming, and you begin by trying to
write a Web Service? that could have something to do with it. You might want
to start with a simple "hello world" console app.

A book about Visual Studio.Net presupposes that one has some experience with
programming. Get yourself a beginning-level programming book, and work your
way up from there. You really don't want to present yourself with too many
challenges at first; you'll get frustrated and quit!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Blaze" <Bl***@discussi ons.microsoft.c om> wrote in message
news:EF******** *************** ***********@mic rosoft.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1 .Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(a uthors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1 .Update(authorC hanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~


Nov 17 '05 #7
Hi Blaze,

I respect your skill with respect to networks. While I am familiar with
networks to the extent that I have to write software that runs on them (and
therefore know a moderate amount about everything), I would hardly want to
jump right into network engineering! I am well aware of my deficiencies in
that area! ;-)

As to the "hello world" app, let me explain a bit.

There are 3 major concepts to programming that are important to understand:
input, output, and processing. Each of these is a world unto itself of
information to be learned and understood. Typically, a programming course or
book will start with what is well-known as a "hello world" app. Don't ask me
where "hello world" came from - probably the same place as "foo bar." Of
course, it doesn't have the same colorful flavor! Someone way back when
decided upon it, and it was picked up and embraced as something easily
recognizable to the community. I'm sure you have similar expressions in
network engineering.

The purpose of a "hello world" application is to introduce the developer to
one of these three concepts: output. Output can take on many forms, but the
earliest and simplest form remains the command-line, or "console" as it is
known today. The only thing that a console app puts out is text. And the
only thing it accepts is text. So, it clears away all the extraneous stuff
to enable the beginner to concentrate of pure concept.

A console app that writes "hello world" would look something like the
following:

namespace ConsoleTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLi ne("hello world.");
}
}
}

Very simple and straightforward . It does introduce a few concepts, such as
namespaces, classes, the Main() method, Single Threaded Apartment Threading
model, and output.

All of these could be discussed, studied and understood before moving on to
the next step, which would be input. For that, the developer would add
something like:

string s = Console.ReadLin e();
Console.WriteLi ne(s);

This introduces a couple more concepts: variables, data types, and output.
Again, each new concept would be studied and understood before moving on.

Most beginning-level books and courses (good ones) include a "hello world"
app to start with. Learning programming is like eating an elephant. It can
be done, but is best done in small "bytes." ;-)

From there, the beginning-level developer adds a bit more, building on what
has already been learned, and often adding to the same program in the
process. Processing could be introduced with something like the following:

int i = 2;
int i2 = 3;
var i3 = i + i2;
Console.WriteLi ne("i = " + i.ToString());
Console.WriteLi ne("i2 = " + i2.ToString());
Console.WriteLi ne("i + i2 = " + i3.ToString());

Again, a simple, but powerful and clear example, which also introduces the
concept of Methods (the Int32.ToString( ) Method),
and operators ("+"), as well as operator overloading ("+" used for addition,
as well as for string concatentation) .

After that, other basic concepts, like sequence, selection, and iteration
could be introduced, studied, and mastered.

The idea here is that all programming, from a simple Console app to a Web
Service, does the same things "under the hood." Programming is like
mathematics (actually, programming *is* mathematics), which is all based on
counting at the lowest level. Addition is counting up. Subtraction is
counting down. Multiplication is counting addition operations. Division is
counting subtraction operations. Fractions express division operations. And
so on, defining arithmetic. Algebra is arithmetic with symbols representing
numbers and arithmetic statements that evaluate to numbers. And so on.

The same goes for programming. All programming is based upon the concepts of
input, output, and processing, and involves sequence, selection, and
iteration. Text is just numeric values translated into graphical
representations of the letters that correspond to the numbers. Graphics, and
graphical user interfaces, for example, are simply long strings of numbers
which are broken up into substrings of equal length, each representing a
combination of 3 numbers whose values represent intensities of red, green,
and blue, and displayed by coloring pixels on the screen with the color
values represented by those numbers, one line on top of the other, creating
a rectangle.

Each level of programming builds on the level below it. Skipping the lower
levels, while an attractive prospect to some, tends to cripple the student
at some point, requiring a re-learning of that which was skipped previously.
Sort of like trying to learn calculus after skipping trigonometry.

If you start with the basics, however, and work your way up, it isn't really
hard at all.

For the most part, of course! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox

"Blaze" <Bl***@discussi ons.microsoft.c om> wrote in message
news:AB******** *************** ***********@mic rosoft.com...
I have 2 books on the way. I know a TON about web services and how to use
them and the way XML interacts with apps. I am a very experienced network
engineer with a pretty good grasp on technology. I just don't know how to
program, but am learning by myself. Do you have a suggested reading on the
"hello world" console app?

Thanks!

Blaze

"Kevin Spencer" wrote:
Dude, you're just starting to learn programming, and you begin by trying
to
write a Web Service? that could have something to do with it. You might
want
to start with a simple "hello world" console app.

A book about Visual Studio.Net presupposes that one has some experience
with
programming. Get yourself a beginning-level programming book, and work
your
way up from there. You really don't want to present yourself with too
many
challenges at first; you'll get frustrated and quit!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

Nov 17 '05 #8
>
namespace ConsoleTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLi ne("hello world.");
}
}
}

Very simple and straightforward . It does introduce a few concepts, such as
namespaces, classes, the Main() method, Single Threaded Apartment
Threading model, and output.


A couple of things here:

Firstly the code won't compile as it stands - this is the simplest app you
can write in C#, paste it into a .cs file created with notepad and once
saved, run csc.exe against the file. This will print out "Hello world".

class App
{
static void Main()
{
System.Console. WriteLine("Hell o world");
}
}

This is as much as anyone needs to get started. And then the rest of your
post is great Kevin about taking it further. We can introduce the using
statement

using System;
class App
{
static void Main()
{
Console.WriteLi ne("Hello world");
}
}

Note that this means you no longer have to write System.Console and is a way
of saving yourself some typing when you use alot of types from the same
namespace.

Secondly: introducing concepts such as COM apartment threading to someone
just starting out is way too much information and something that is
absolutely not necessary at this stage.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Nov 17 '05 #9
LOL... Thank you for all the information, I will use it in all gratefullness
as I learn a new avenue in the computer world.

BTW, I agree about the Apartment Threading... I live in a house and don't
like to sew:)

Thanks guys... You've pointed me in the right direction.

See you back here in a few weeks when I get my books and start away!

Blaze

"Richard Blewett [DevelopMentor]" wrote:

namespace ConsoleTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLi ne("hello world.");
}
}
}

Very simple and straightforward . It does introduce a few concepts, such as
namespaces, classes, the Main() method, Single Threaded Apartment
Threading model, and output.


A couple of things here:

Firstly the code won't compile as it stands - this is the simplest app you
can write in C#, paste it into a .cs file created with notepad and once
saved, run csc.exe against the file. This will print out "Hello world".

class App
{
static void Main()
{
System.Console. WriteLine("Hell o world");
}
}

This is as much as anyone needs to get started. And then the rest of your
post is great Kevin about taking it further. We can introduce the using
statement

using System;
class App
{
static void Main()
{
Console.WriteLi ne("Hello world");
}
}

Note that this means you no longer have to write System.Console and is a way
of saving yourself some typing when you use alot of types from the same
namespace.

Secondly: introducing concepts such as COM apartment threading to someone
just starting out is way too much information and something that is
absolutely not necessary at this stage.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Nov 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2205
by: Rod Carrol | last post by:
Hello all, As a beginner I've been exeperiencing lots of errors while building my website, (I'm currently attempting to implement a member login/registration piece for my site using mySQL and PHP) I've read that PHP is secure in that it hides lots of code from hackers and people trying to snoop around on the web site running the PHP scripts - however, one thing I've noticed is that whenever I get a script error, (for example, failure...
3
1292
by: AAA | last post by:
I want to start programming in MS Visual C++. I understand that .NET is required? Or do I have to get MSStudio to integrate my work into the NET frame work? And any idea when VS 2005 is going to come out. Should I buy MSC++ now and then up-grade? I need some real basic fatherly advice in very some simple English. I programmed a little (basic) and took a C course. Both were over 10 years ago and now I'm retired and want to program as a...
7
1723
by: Steve Richter | last post by:
When I build a C# class and install it in the GAC, my code works as it should, my .aspx code finds the DLL and can run a static method: <%@ Assembly Name="AutoCoder, Culture=neutral, Version=1.0.1922.22245, PublicKeyToken=0a4067d718757385" %> <%@ Import Namespace="AutoCoder" %> Trace.Write( "AutoCoder", AutoCoder.Common.GetConnectionString( )) ; But I cant locate the assembly in its directory using the src= property.
36
2537
by: utab | last post by:
Dear, I have experince in C( numerical projects, like engineering problems, scientific applications) I have the basic notion of C++ also, I have read Accelerated C++ until Chapter 7, however it seems that it discusses the std and the other part of the language with your own abstractions. Is that better to read a book first on the basic concepts of C++ language (but not the C part) that gives the basics as if the reader is a beginner...
11
2501
by: herpers | last post by:
Hello, I probably don't see the obvious, but maybe you can help me out of this mess. The following is my problem: I created two classes NormDistribution and DiscDistribution. Both classes provide an implemation of the operator +. Now I want to write another generic class Plan<DType>, which can
4
1281
by: GW | last post by:
Hello, I started to study c# .net today, coming from a background of classic ASP VBScript. I am having an issue with one of my beginner projects, a real simple one too. I have three files: index.aspx
6
1500
by: jukebox239 | last post by:
im a java high school student and im just a beginner and my teacher gave me this OOP scenario that i thought about for so long but didnt know how to design a program for it. The scenario is: "A Quadrilateral has LineSegments. A LineSegment is made up of 2 Points (with coordinates). Then my task was to think of verbs that fit and could be added to this class and code methods for the class. I thought about it and im not sure whether to use...
6
1473
by: ryanbayona | last post by:
I really wanted to learn C++ thats why i took the initiative to self- study. I am currently following the tutorial at this site: http://www.cprogramming.com/tutorial.html#c++tutorial but im finding it a little lacking in some information i need, like data types, native c++ objects and c++ functions. I am on linux and have been compiling and running my c++ samples using the G++ compiler, is that Ok? I mean will C++ code written in linux ...
22
18151
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php programmer and looking for a starting point in regards to practical projects to work on. What are some projects that beginner programmers usually start with? Please list a few that would be good for a beginner PHP programmer to
0
9298
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10072
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
9737
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
8737
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
7286
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
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
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
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
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.