ADO.NET Core Reference question

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.
 
M

Mary Chipman

Go into the properties for the project and set the startup object to
your form.

--Mary
 
D

DaveInRedmond

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.
 
M

Mary Chipman

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
 
D

DaveInRedmond

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
 
M

Mary Chipman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

EULA questions 11
What Do I Need to Backup? 1
ASUS TR-DLS 1
XP Pro upgrade issues 3
XP Pro upgrade issues 3
can't add row to ms access table 19
can't add row in code to access mdb 1
can't create new rows by code 1

Top