ADO.NET Core Reference question

  • Thread starter Thread starter DaveInRedmond
  • Start date Start date
D

DaveInRedmond

I just purchased the "Microsoft ADO.NET (Core Reference) by Sceppa and have
a simple question that I haven't been able to see answered elsewhere. In
building the Chapter 2 exercise in C# using Visual Studio 2003 Pro where you
use the DataForm wizard and *try* to make the resultant dataform the startup
object, DataForm1 doesn't have a Main and the build fails. There is no
problem with VB. Am I missing something quite basic here? Given that there's
nothing code specific between the 2 other than what the wizard inserts, why
should this fail like this? A wizard problem or a nooB issue?
--
.......................................................................
Remove NOSPAM. before replying

Pursuant to U.S. code, title 47, Chapter 5, Subchapter II, Section 227
Any and all unsolicited commercial E-mail sent to this address is
subject to a fee of US $500.00. E-Mailing denotes acceptance of these
terms. Consult <http://www.law.cornell.edu/uscode/47/227.html> for
details.
 
Go into the properties for the project and set the startup object to
your form.

--Mary
 
Mary -

Thanx for your help, but the form does not appear on the drop down. When I
tried to add it manually, I got the build error. The issue seems to be that
the form does not have a valid startup object when created in C# but does
when created in VB. I've checked my preferences to see if there was
something there, but nothing obvious showed up.

Dave

--
.......................................................................
Remove NOSPAM. before replying

Pursuant to U.S. code, title 47, Chapter 5, Subchapter II, Section 227
Any and all unsolicited commercial E-mail sent to this address is
subject to a fee of US $500.00. E-Mailing denotes acceptance of these
terms. Consult <http://www.law.cornell.edu/uscode/47/227.html> for
details.
 
Insert the following in the DataForm1 form right after the Windows
Form Designer generated code section:

[STAThread]
static void Main()
{
Application.Run(new DataForm1());
}

--Mary
 
Thanx for the continued help, but I'm still curious why the Wizard doesn't
do that in C# while it creates a comparable function in VB - especially as
this is a *very* basic procedure in a *very* commonly read book. I would
have expected someone else to have tripped over it long ago (I can't be the
only one actually doing the C# exercises by hand) and thus I was more
concerned that there was something specific to my
installation/configuration.

Dave

--
.......................................................................
Remove NOSPAM. before replying

Pursuant to U.S. code, title 47, Chapter 5, Subchapter II, Section 227
Any and all unsolicited commercial E-mail sent to this address is
subject to a fee of US $500.00. E-Mailing denotes acceptance of these
terms. Consult <http://www.law.cornell.edu/uscode/47/227.html> for
details.




Mary Chipman said:
Insert the following in the DataForm1 form right after the Windows
Form Designer generated code section:

[STAThread]
static void Main()
{
Application.Run(new DataForm1());
}

--Mary

Mary -

Thanx for your help, but the form does not appear on the drop down. When I
tried to add it manually, I got the build error. The issue seems to be that
the form does not have a valid startup object when created in C# but does
when created in VB. I've checked my preferences to see if there was
something there, but nothing obvious showed up.

Dave
 
I don't know -- personally, I try to avoid the wizards at all times
because there's always some problem or other with the code they
generate that ends up taking more time in the long run to figure out
than if you'd just built everything by hand.

--Mary
 
Back
Top