p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspdotnet_website_programming thread: Re: How to get thePhile running under .NET Framework 1.1 beta & MSDE


Message #1 by "Austin" <alam@a...> on Tue, 4 Feb 2003 22:10:41
> I just picked up this book and I can't tell you how enlightening this
book has been for me.  Great Job on the book~

One criticism would be that the source code doesn't give an easy way to
setup the thePhile site for people who can't afford MSSQL Server 7.

*** I don't know why the authors didn't distribute a MSDE version
instead of the costly MSSQL7 version ***

I currently have the beta version of .NET framework 1.1 and MSDE
installed on my machine.  I just successfully installed the thePhile
site after a few hours of researching on the internet...

Here's how to get the thePhile site up and running with MSDE...

Make sure you have the following installed on your machine...

- .NET Framework
- Visual Studio.NET
- MSDE
- Access 2000 or XP

After installing all of the above you have to change 1 setting in the
registry.  (**Make sure to make a backup of the registry before you
start**)

Step 1) Run "regedit" to bring up the registry editor
Step 2) Goto:

"HKEY_LOCAL_MACHINE : SOFTWARE : Microsoft : MSSQLServer : MSSQLServer"

Step 3) Double click on the entry that says "LoginMode" and set the
value to "0"

Note: 

"0" (zero) = logon using Mixed Mode Authentication (required)
"1" (one) = logon using Integrated or NT authentication only
"2" (two) = logon using SQL Authentication only

Step 4) Restart the MSDE SQL Server

Step 5) Open the Visual Studio.NET command prompt

Step 6) Login to osql:

osql -Usa -P -S <server_name>

Hit enter and you should get:

1> 

Good~ Now we know that you can login as sa.  At this point I strongly
recommend assigning a password to sa but then you have to add the
password to all the Config files... So I didn't add the password in the
instructions...

Step 7) Create the thePhile database

1> create database thePhile
2> go

Step 8) Restart the SQL Server

Step 7) Setup the thePhile site according to the install instruction
found in the "Sample_code.zip" that you downloaded from wrox.  Change
the necessary config files to get error handling working.

You should have a virtual directory pointing to c:\wrox\thePhile

Step 8) We will not create the thePhile database, but the problem is
that MSDE can't properly restore the database-backup properly.  When you
try to restore the database using osql it can't find the original
directories and bombs out... so we have to create the MSSQL default
directory ourselves... 

in the DOS prompt:

mkdir c:\MSSQL7 <enter>
cd MSSQL7 <enter>
mkdir data <enter>

you should now have c:\MSSQL7\data in your C: drive

Step 9) Open Access to install the DB 

I don't know why but you have to use access to restore the DB... osql
doesn't want to restore the files...

Step 10) Open a new project (not a database)

Step 11) Connect the project to the SQL server by going under "File"
then "Connection"

Step 12) Fill out the Server Name (your computer name)

Step 13) Select either "Use Windows NT Integrated security" or "Use a
specific user name and password" 

If you select to enter a specific username and password, enter sa and
then select "blank password"

Step 14) Select the thePhile database then click on Test Connection to
check your authorization is set.

Step 15) Click OK

Step 16) Select the "Tools" Menu -> "Database Utilities" -> "Restore SQL
Database"

Step 17) Click "yes"

Step 18) Select the database-backup file found in the "sample_code.zip"
file then click "OK"  You should probably add a .dat to the file...

Now you should be able to view the tables and queries...etc in Access

***that's it***

You need to rebuild the thePhile solution before you can access the
site...
If you have .NET framework 1.1 beta installed you will see some warnings
when you rebuild the site... some of the xml code has apparently become
deprecated.

Point your browser to http://localhost/thePhile/ and the site should
work...
Of course you have to change the necessary settings as explained in the
install page.

MSDE is nice because it's practically like MSSQL 2000 without the GUI
management tools and it has a 2 gig boundary limit but for portals and
web sites this should not be a problem.  You can now install thePhile on
ISPs or  test and hack the thePhile site on your workstation~ Woot!!!

There are probably some errors in the instructions... I'm pretty sure
the instructions are correct.  

Let me know if you have any questions

Thanks,

John Hwang

Message #2 by "Austin" <alam@a...> on Tue, 4 Feb 2003 22:13:55
Could you tele me where is the VS.net  command promp?

I need to create the database for each moudle myself?

Thanks
Austin




> I just picked up this book and I can't tell you how enlightening this
book has been for me.  Great Job on the book~

One criticism would be that the source code doesn't give an easy way to
setup the thePhile site for people who can't afford MSSQL Server 7.

*** I don't know why the authors didn't distribute a MSDE version
instead of the costly MSSQL7 version ***

I currently have the beta version of .NET framework 1.1 and MSDE
installed on my machine.  I just successfully installed the thePhile
site after a few hours of researching on the internet...

Here's how to get the thePhile site up and running with MSDE...

Make sure you have the following installed on your machine...

- .NET Framework
- Visual Studio.NET
- MSDE
- Access 2000 or XP

After installing all of the above you have to change 1 setting in the
registry.  (**Make sure to make a backup of the registry before you
start**)

Step 1) Run "regedit" to bring up the registry editor
Step 2) Goto:

"HKEY_LOCAL_MACHINE : SOFTWARE : Microsoft : MSSQLServer : MSSQLServer"

Step 3) Double click on the entry that says "LoginMode" and set the
value to "0"

Note: 

"0" (zero) = logon using Mixed Mode Authentication (required)
"1" (one) = logon using Integrated or NT authentication only
"2" (two) = logon using SQL Authentication only

Step 4) Restart the MSDE SQL Server

Step 5) Open the Visual Studio.NET command prompt

Step 6) Login to osql:

osql -Usa -P -S <server_name>

Hit enter and you should get:

1> 

Good~ Now we know that you can login as sa.  At this point I strongly
recommend assigning a password to sa but then you have to add the
password to all the Config files... So I didn't add the password in the
instructions...

Step 7) Create the thePhile database

1> create database thePhile
2> go

Step 8) Restart the SQL Server

Step 7) Setup the thePhile site according to the install instruction
found in the "Sample_code.zip" that you downloaded from wrox.  Change
the necessary config files to get error handling working.

You should have a virtual directory pointing to c:\wrox\thePhile

Step 8) We will not create the thePhile database, but the problem is
that MSDE can't properly restore the database-backup properly.  When you
try to restore the database using osql it can't find the original
directories and bombs out... so we have to create the MSSQL default
directory ourselves... 

in the DOS prompt:

mkdir c:\MSSQL7 <enter>
cd MSSQL7 <enter>
mkdir data <enter>

you should now have c:\MSSQL7\data in your C: drive

Step 9) Open Access to install the DB 

I don't know why but you have to use access to restore the DB... osql
doesn't want to restore the files...

Step 10) Open a new project (not a database)

Step 11) Connect the project to the SQL server by going under "File"
then "Connection"

Step 12) Fill out the Server Name (your computer name)

Step 13) Select either "Use Windows NT Integrated security" or "Use a
specific user name and password" 

If you select to enter a specific username and password, enter sa and
then select "blank password"

Step 14) Select the thePhile database then click on Test Connection to
check your authorization is set.

Step 15) Click OK

Step 16) Select the "Tools" Menu -> "Database Utilities" -> "Restore SQL
Database"

Step 17) Click "yes"

Step 18) Select the database-backup file found in the "sample_code.zip"
file then click "OK"  You should probably add a .dat to the file...

Now you should be able to view the tables and queries...etc in Access

***that's it***

You need to rebuild the thePhile solution before you can access the
site...
If you have .NET framework 1.1 beta installed you will see some warnings
when you rebuild the site... some of the xml code has apparently become
deprecated.

Point your browser to http://localhost/thePhile/ and the site should
work...
Of course you have to change the necessary settings as explained in the
install page.

MSDE is nice because it's practically like MSSQL 2000 without the GUI
management tools and it has a 2 gig boundary limit but for portals and
web sites this should not be a problem.  You can now install thePhile on
ISPs or  test and hack the thePhile site on your workstation~ Woot!!!

There are probably some errors in the instructions... I'm pretty sure
the instructions are correct.  

Let me know if you have any questions

Thanks,

John Hwang

Message #3 by "John Hwang" <jhwang@c...> on Wed, 5 Feb 2003 03:42:53
> Could you tele me where is the VS.net  command promp?
> I need to create the database for each moudle myself?

> Thanks
Austin

Austin,

You can find the VS.net command prompt under the "Visual Studio.NET Tools" 
in your "Microsoft Visual Studio.NET" programs menu.

So...

Start >>> Programs >>> Microsoft Visual Studio.NET >>> Visual Studio.NET 
Tools >>> Visual Studio.NET Command Prompt

I'm pretty sure you can run 'osql' from the generic command prompt.  I 
like to use the VS.NET command prompt because I can run the compiler from 
the console.  My mistake for leading you to think that you had to use the 
VS.NET command prompt to run osql...

As for the database... If you're trying to just get thePhile running, the 
sql will create all the tables you need for you.  There should only be 1 
database called ThePhile containing LOTS of tables.  If you scan ahead of 
the book, you'll see that each module utilizes multiple tables.  Once 
again, you don't have to create them yourself.  Use the script like I did 
in my previous post.  Don't try to do it yourself because to follow the 
book, it's critical that you have ThePhile site running.

Hope this answers your questions... 

John Hwang
Message #4 by "Austin Lam" <ALam@a...> on Wed, 5 Feb 2003 08:32:21 -0500
Thanks John,

I will look into it now.

Austin

-----Original Message-----
From: John Hwang [mailto:jhwang@c...]
Sent: Tuesday, February 04, 2003 10:43 PM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] Re: How to get thePhile running
under .NET Framework 1.1 beta & MSDE


> Could you tele me where is the VS.net  command promp?
> I need to create the database for each moudle myself?

> Thanks
Austin

Austin,

You can find the VS.net command prompt under the "Visual Studio.NET 
Tools"
in your "Microsoft Visual Studio.NET" programs menu.

So...

Start >>> Programs >>> Microsoft Visual Studio.NET >>> Visual Studio.NET 

Tools >>> Visual Studio.NET Command Prompt

I'm pretty sure you can run 'osql' from the generic command prompt.  I
like to use the VS.NET command prompt because I can run the compiler 
from
the console.  My mistake for leading you to think that you had to use 
the
VS.NET command prompt to run osql...

As for the database... If you're trying to just get thePhile running, 
the
sql will create all the tables you need for you.  There should only be 1 

database called ThePhile containing LOTS of tables.  If you scan ahead 
of
the book, you'll see that each module utilizes multiple tables.  Once
again, you don't have to create them yourself.  Use the script like I 
did
in my previous post.  Don't try to do it yourself because to follow the
book, it's critical that you have ThePhile site running.

Hope this answers your questions...

John Hwang
---
Professional Design Patterns in VB.NET:
Building Adaptable Applications

Want to know how design patterns bring reusable
design and adaptabilty to your applications? How
to recognize the need for a design pattern
solution? How to select, design, and implement
the right patterns? How parts of the .NET Framework
(like the .NET Data Providers and .NET Remoting)
take advantage of design patterns? This book
presents a practical approach to using design
patterns in VB.NET, by focusing on the relevance
of design patterns in the different tiers of a
distributed n-tier architecture.

http://www.wrox.com/books/1861006985.htm

*************************************************
CONFIDENTIAL
This message contains confidential information and is intended only for 
Website Programming with ASP.NET. If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail. Please notify 
the sender immediately by e-mail if you have received this e-mail by 
mistake and delete this e-mail from your system.

WARNING: Computer viruses can be transmitted via email. The recipient 
should check this email and any attachments for the presence of viruses. 
Anderson Power Products accepts no liability for any damage caused by 
any virus transmitted by this email.
*************************************************
Message #5 by "Blue Tiger" <bluetiger@m...> on Thu, 6 Feb 2003 01:54:53 -0500
Hello all, 
	I'm still having a lot of trouble with this. I get 56 build errors
after unzipping ThePhile and rebuilding the solution in VS.NET as
instructions dictated. I recreated the database okay & can view that with
SQL Enterprise Manager. The error in the web page: Parser Error Message:
Could not load type 'Wrox.ThePhile.Web.Global'. I've repeated the steps 4
times according to the instructions to no avail. Help! Ideas?

Thanks,
Ryan

Message #6 by "John Hwang" <jhwang@c...> on Fri, 7 Feb 2003 18:45:46
Ryan,

The problem is most likely where you placed ThePhile directory.  ThePhile 
contains a digital signature that makes the project "strong-named."  The 
books describes this in pg 33 and in pg 34, you will find instructions on 
how to modify the AssemblyInfo.cs if you need to change the location of 
the key.

Due to the way the site was coded, the sure and hassle free way to get 
ThePhile running is to make sure that you place "wrox" directory at the 
ROOT level.  

C:\wrox
C:\wrox\ThePhile
C:\wrox\Keys

Unzip the program and move the wrox directory to C:\.  If the above 
doesn't correct the problem, post the errors that VS.NET spits out.

John Hwang
Message #7 by "Blue Tiger" <bluetiger@m...> on Tue, 11 Feb 2003 20:57:49 -0500
Okay.....I've rebuilt without errors.
When I try to open the site, I get the following error:

Page Error

-------------------------------------------------------------------------
---
----
An unexpected error has occurred on this page. The system administrators
have been notified. Please feel free to contact us with the information
surrounding this error.
The error occurred in: http://rd/ThePhile/Default.aspx
Error Message: Login failed for user 'sa'.
-------------------------------------------------------------------------
---
----
Stack Trace:
System.Data.SqlClient.SqlException: Login failed for user 'sa'. at
System.Data.SqlClient.SqlConnection.Open() at
Wrox.WebModules.Data.DbObject.RunProcedure(String storedProcName,
IDataParameter[] parameters, Int32& rowsAffected) in
C:\Wrox\ThePhile\Modules\Core\DbObject.cs:line 104 at
Wrox.WebModules.Polls.Data.Questions.GetCurrentID() in
C:\Wrox\ThePhile\Modules\Polls2\Polls.Data\Questions.cs:line 94 at
Wrox.WebModules.Polls.Business.Question.GetCurrentID() in
C:\Wrox\ThePhile\Modules\Polls2\Polls.Business\Question.cs:line 129 at
Wrox.WebModules.Polls.Web.Controls.User.Poll.DataBind() in
C:\Wrox\ThePhile\Modules\Polls2\Poll.ascx.cs:line 123 at
Wrox.WebModules.Polls.Web.Controls.User.Poll.Page_Load(Object sender,
EventArgs e) in C:\Wrox\ThePhile\Modules\Polls2\Poll.ascx.cs:line 114 at
System.Web.UI.Control.OnLoad(EventArgs e) at
System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Page.ProcessRequestMain()

I tried changing the login to a blank password, tried using my normal
password to the database, and still no luck. What am I missing?

Thanks,
Ryan

Message #8 by "John Hwang" <jhwang@c...> on Mon, 17 Feb 2003 18:53:44
Ryan,

The fact that you got an error message is good because it means the source 
was compiled and exception handling is working... You should be able to 
see an entry in the error in your MMC.

Did you change the sa's password?  If you did, you need to update the 
passwords in each web module's config file.  You will find it under the 
Config directory under ThePhile directory.  Open each file up and 
change/add the password to each file.

First make sure you can connect properly to the MSSQL using the sa and 
password.

Then, update the username and password in the config files...

Hope this helps,

John Hwang

BTW, you don't have to use the sa as the account to access thePhile DB.  
Actually, it's better not to use sa for security purposes... 

Message #9 by "Blue Tiger" <bluetiger@m...> on Tue, 18 Feb 2003 12:51:26 -0500
I updated the sa password & made the changes in the web.config file. I
verified that I can log into ThePhile database with osql using the new
password, as well as using Enterprise Manager, and the WebData Admin 
tool
from Microsoft.  From the event viewer, I get this:
Event Type:	Warning
Event Source:	W3SVC
Computer:	RD
Description:
The server was unable to logon the Windows NT account 'RD\ASPNET' due to 
the
following error: Logon failure: unknown user name or bad password.  The 
data
is the error code.

What settings might I need to change in IIS? The current web.config
connectionString looks like this:
stateConnectionString=3D"tcpip=3D127.0.0.1:42424"
sqlConnectionString=3D"server=3DRD;database=3DThePhile;uid=3Dsa;pwd=3D***
***;"

Ideas?

Thanks for all the help,
Ryan

-----Original Message-----
From: John Hwang [mailto:jhwang@c...]
Sent: Monday, February 17, 2003 6:54 PM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] Re: How to get thePhile running
under .NET Framework 1.1 beta & MSDE

Ryan,

The fact that you got an error message is good because it means the 
source
was compiled and exception handling is working... You should be able to
see an entry in the error in your MMC.

Did you change the sa's password?  If you did, you need to update the
passwords in each web module's config file.  You will find it under the
Config directory under ThePhile directory.  Open each file up and
change/add the password to each file.

First make sure you can connect properly to the MSSQL using the sa and
password.

Then, update the username and password in the config files...

Hope this helps,

John Hwang

BTW, you don't have to use the sa as the account to access thePhile DB.  

Actually, it's better not to use sa for security purposes...

---
Professional Design Patterns in VB.NET:
Building Adaptable Applications

Want to know how design patterns bring reusable
design and adaptabilty to your applications? How
to recognize the need for a design pattern
solution? How to select, design, and implement
the right patterns? How parts of the .NET Framework
(like the .NET Data Providers and .NET Remoting)
take advantage of design patterns? This book
presents a practical approach to using design
patterns in VB.NET, by focusing on the relevance
of design patterns in the different tiers of a
distributed n-tier architecture.

http://www.wrox.com/books/1861006985.htm



  Return to Index