Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Thursday, March 29, 2012

newbie - keeping my object data as page refreshes

Hi all

I have some experience in 'Windows' programming but I am new to Web
programming, I wonder if anyone can help.

I have a middle layer object that brings some data from a database class .
The class reprsents a Callout, has lots of methods and properties and
manages the business logic..

I then have a html page (GUI layer) that creates an instance of a callout,
and from the callout object, it displays some textfields, labour etc plus
some datagrids based on some collections it holds.

Everything works fine until the page refreshes, at which time the object
seems to be destroyed and then recreated.

I want to keep the object alive with its existing data, on the server, and
connect back to it , ie. not create a new object each time. I know I could
use my Callouts WriteDate event to persist the data back to the SQLServer,
and then just re load it, but this isn't what I really want. I would like to
keep the object live until all work has been completed.

I have read a few things about sessions states etc, but don't really know
where to start, and how to make the class persist.

initially I had

public partial class CallOutDetail : System.Web.UI.Page
{
ExistingCallout Currentcallout;
int m_CalloutPK = 0;

protected void Page_Load(object sender, EventArgs e)
{
m_CalloutPK = 1212;
Currentcallout = new ExistingCallout(m_CalloutPK);

I have tried putting the Currentcallout in not postback i.e.

public partial class CallOutDetail : System.Web.UI.Page
{
ExistingCallout Currentcallout;
int m_CalloutPK = 0;

protected void Page_Load(object sender, EventArgs e)
{
m_CalloutPK = 1212;
if (!IsPostBack)
{
// first time
Currentcallout = new ExistingCallout(m_CalloutPK);
SetLabour();
SetMaterials();
}

Any pointers would be welcome

thanks

Andycouple options...
both require that it be serialized

you can place it in the Page's viewstate...

private constant vs_callout="A";

protected CalloutType CurrentCallout{
get{return this.ViewState[vs_callout] as CalloutType;}
set{this.ViewState[vs_callout] = value;}
}

...or place it in the session
}

"AAJ" wrote:

Quote:

Originally Posted by

Hi all
>
I have some experience in 'Windows' programming but I am new to Web
programming, I wonder if anyone can help.
>
I have a middle layer object that brings some data from a database class .
The class reprsents a Callout, has lots of methods and properties and
manages the business logic..
>
I then have a html page (GUI layer) that creates an instance of a callout,
and from the callout object, it displays some textfields, labour etc plus
some datagrids based on some collections it holds.
>
Everything works fine until the page refreshes, at which time the object
seems to be destroyed and then recreated.
>
I want to keep the object alive with its existing data, on the server, and
connect back to it , ie. not create a new object each time. I know I could
use my Callouts WriteDate event to persist the data back to the SQLServer,
and then just re load it, but this isn't what I really want. I would like to
keep the object live until all work has been completed.
>
I have read a few things about sessions states etc, but don't really know
where to start, and how to make the class persist.
>
initially I had
>
public partial class CallOutDetail : System.Web.UI.Page
{
ExistingCallout Currentcallout;
int m_CalloutPK = 0;
>
protected void Page_Load(object sender, EventArgs e)
{
m_CalloutPK = 1212;
Currentcallout = new ExistingCallout(m_CalloutPK);
>
>
I have tried putting the Currentcallout in not postback i.e.
>
public partial class CallOutDetail : System.Web.UI.Page
{
ExistingCallout Currentcallout;
int m_CalloutPK = 0;
>
protected void Page_Load(object sender, EventArgs e)
{
m_CalloutPK = 1212;
if (!IsPostBack)
{
// first time
Currentcallout = new ExistingCallout(m_CalloutPK);
SetLabour();
SetMaterials();
}
>
>
Any pointers would be welcome
>
thanks
>
Andy
>
>
>


thanks David

"David Jessee" <DavidJessee@.discussions.microsoft.comwrote in message
news:CF0F5237-8616-4C4B-9DA9-252BA0946C1D@.microsoft.com...

Quote:

Originally Posted by

couple options...
both require that it be serialized
>
you can place it in the Page's viewstate...
>
private constant vs_callout="A";
>
protected CalloutType CurrentCallout{
get{return this.ViewState[vs_callout] as CalloutType;}
set{this.ViewState[vs_callout] = value;}
}
>
...or place it in the session
}
>
>
>
"AAJ" wrote:
>

Quote:

Originally Posted by

>Hi all
>>
>I have some experience in 'Windows' programming but I am new to Web
>programming, I wonder if anyone can help.
>>
>I have a middle layer object that brings some data from a database class
>.
>The class reprsents a Callout, has lots of methods and properties and
>manages the business logic..
>>
>I then have a html page (GUI layer) that creates an instance of a
>callout,
>and from the callout object, it displays some textfields, labour etc plus
>some datagrids based on some collections it holds.
>>
>Everything works fine until the page refreshes, at which time the object
>seems to be destroyed and then recreated.
>>
>I want to keep the object alive with its existing data, on the server,
>and
>connect back to it , ie. not create a new object each time. I know I
>could
>use my Callouts WriteDate event to persist the data back to the
>SQLServer,
>and then just re load it, but this isn't what I really want. I would like
>to
>keep the object live until all work has been completed.
>>
>I have read a few things about sessions states etc, but don't really know
>where to start, and how to make the class persist.
>>
>initially I had
>>
>public partial class CallOutDetail : System.Web.UI.Page
>{
>ExistingCallout Currentcallout;
>int m_CalloutPK = 0;
>>
>protected void Page_Load(object sender, EventArgs e)
>{
>m_CalloutPK = 1212;
>Currentcallout = new ExistingCallout(m_CalloutPK);
>>
>>
>I have tried putting the Currentcallout in not postback i.e.
>>
>public partial class CallOutDetail : System.Web.UI.Page
>{
>ExistingCallout Currentcallout;
>int m_CalloutPK = 0;
>>
>protected void Page_Load(object sender, EventArgs e)
>{
>m_CalloutPK = 1212;
>if (!IsPostBack)
>{
>// first time
>Currentcallout = new ExistingCallout(m_CalloutPK);
>SetLabour();
>SetMaterials();
>}
>>
>>
>Any pointers would be welcome
>>
>thanks
>>
>Andy
>>
>>
>>

Newbie - Problem Loading SLN files.

Hi All,

I am having a problem that is driving me crazy.

I have Windows 2000 Professional, Visual Studio Professional, IIS installed
and running...

I am reading ASP.NET Developer's JumpStart by Paul Sheriff and Ken Getz.
I've downloaded the examples and now want to try some of them out.

In VS, I go to the File Menu and Select, Open Solution. I go to the
directory that the installer put the book's files and select the SLN file.I
then get the following error:
Unable to get the project file from the Web Server. Unable to open Web
Project 'JumpStart/VBLanguage.' The Web 'JumpStart/VBLanguage' located
on server 'http://localhost/' does not exist.

In IIS, their is a virtual directory for JumpStart. I've tried creating one
for VBLanguage but I still am getting errors.

I then tried just opening the Project. I had to use a URL
(http://localhost/jumpstart/vblanguage/vblanguage.vbproj) and I can open it,
but I get the message: "You do not have permission to make changes to this
document. Do you want to open a read-only copy?"
I answer Yes, but I still get the error that it is unable to get the project
file from the Web Server.

I can't reproduce exactly what I did before, but at one point I think I made
my own Solution file and added everything, but I could not view any of the
pages in Design view.

I just want to learn this stuff. I've spent too long just trying to open a
file and no time reading and learning. It had been very frustrating (thanks
for letting me vent).

Thank you for any help you can provide.

-RobI think you need to contact either Paul Sheriff or Ken Getz for your answer.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Rob G" <gumbatman@.hotmail.com> wrote in message
news:100t3elpo11ir12@.corp.supernews.com...
> Hi All,
> I am having a problem that is driving me crazy.
> I have Windows 2000 Professional, Visual Studio Professional, IIS
installed
> and running...
> I am reading ASP.NET Developer's JumpStart by Paul Sheriff and Ken Getz.
> I've downloaded the examples and now want to try some of them out.
> In VS, I go to the File Menu and Select, Open Solution. I go to the
> directory that the installer put the book's files and select the SLN
file.I
> then get the following error:
> Unable to get the project file from the Web Server. Unable to open Web
> Project 'JumpStart/VBLanguage.' The Web 'JumpStart/VBLanguage'
located
> on server 'http://localhost/' does not exist.
> In IIS, their is a virtual directory for JumpStart. I've tried creating
one
> for VBLanguage but I still am getting errors.
> I then tried just opening the Project. I had to use a URL
> (http://localhost/jumpstart/vblanguage/vblanguage.vbproj) and I can open
it,
> but I get the message: "You do not have permission to make changes to this
> document. Do you want to open a read-only copy?"
> I answer Yes, but I still get the error that it is unable to get the
project
> file from the Web Server.
> I can't reproduce exactly what I did before, but at one point I think I
made
> my own Solution file and added everything, but I could not view any of the
> pages in Design view.
> I just want to learn this stuff. I've spent too long just trying to open a
> file and no time reading and learning. It had been very frustrating
(thanks
> for letting me vent).
> Thank you for any help you can provide.
> -Rob
Maybe, but I installed it on a different PC with no problems. So I figured
it was a Microsoft problem, not Paul Sherrif's or Ken Getz's.

"Kevin Spencer" <kevin@.takempis.com> wrote in message
news:OMJfmRD4DHA.3944@.tk2msftngp13.phx.gbl...
> I think you need to contact either Paul Sheriff or Ken Getz for your
answer.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
> "Rob G" <gumbatman@.hotmail.com> wrote in message
> news:100t3elpo11ir12@.corp.supernews.com...
> > Hi All,
> > I am having a problem that is driving me crazy.
> > I have Windows 2000 Professional, Visual Studio Professional, IIS
> installed
> > and running...
> > I am reading ASP.NET Developer's JumpStart by Paul Sheriff and Ken Getz.
> > I've downloaded the examples and now want to try some of them out.
> > In VS, I go to the File Menu and Select, Open Solution. I go to the
> > directory that the installer put the book's files and select the SLN
> file.I
> > then get the following error:
> > Unable to get the project file from the Web Server. Unable to open
Web
> > Project 'JumpStart/VBLanguage.' The Web 'JumpStart/VBLanguage'
> located
> > on server 'http://localhost/' does not exist.
> > In IIS, their is a virtual directory for JumpStart. I've tried creating
> one
> > for VBLanguage but I still am getting errors.
> > I then tried just opening the Project. I had to use a URL
> > (http://localhost/jumpstart/vblanguage/vblanguage.vbproj) and I can open
> it,
> > but I get the message: "You do not have permission to make changes to
this
> > document. Do you want to open a read-only copy?"
> > I answer Yes, but I still get the error that it is unable to get the
> project
> > file from the Web Server.
> > I can't reproduce exactly what I did before, but at one point I think I
> made
> > my own Solution file and added everything, but I could not view any of
the
> > pages in Design view.
> > I just want to learn this stuff. I've spent too long just trying to open
a
> > file and no time reading and learning. It had been very frustrating
> (thanks
> > for letting me vent).
> > Thank you for any help you can provide.
> > -Rob

Newbie : SMTP Problem

Hi,

I'm a newbie in programming. I have started working on ASP.Net this week. My OS is Windows XP Profesional. IIS 5.1, Visual Studio 2005. I am trying to build a simple user login system from the book "ASP.Net 2.0 Everyday Apps for DUMMIES". I followed every instruction written in the book. Everything is working well apart from sending email to the user while registering or changing password.

Can anyone help me please. Thanx in Advance,

Portion of webconfig file is below:

<system.net>
<mailSettings>
<smtp>
<network host="localhost" port="25" />
</smtp>
</mailSettings>
</system.net>

The error I'm getting is below.

Server Error in '/UserLoginCS' Application.

Mailbox unavailable. The server response was: 5.7.1 Unable to relay forcupidoly@dotnet.itags.org.gmail.com

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay forcupidoly@dotnet.itags.org.gmail.com

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for cupidoly@dotnet.itags.org.gmail.com] System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) +704 System.Net.Mail.SmtpClient.Send(MailMessage message) +2184 System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner) +482 System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +639 System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +199 System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +649 System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +157 System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +39 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +107 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +178 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +72 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Is your PC a email server?If not,you should set a email server in web.config.Besides,can you paste some codes about how do you send emails?

I'm also getting the same error. This error only occurs when email address does not exists.

Error displayed: Server Error in '/' Application. ------------------------ Runtime Error Mailbox unavailable. The server response was: 5.1.1 User unknown Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.1.1 User unknown Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.1.1 User unknown] System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) +800307 System.Net.Mail.SmtpClient.Send(MailMessage message) +2004 System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner) +341 System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +571 System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +105 System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +453 System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +149 System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +17 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +171 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Monday, March 26, 2012

Newbie Advice: UserInteractive mode

Hi All,

I am new to ASP.NET making the move over from windows forms development.

In Windows forms I used to throw an error to a windows form or a message box when I wanted to alert the user about something i.e. invalid password on login.

I would like to know if it is better to place the application into "UserInteractive mode" and use standard dialog boxes or should i be creating pages to report such things.

Any applications I produce will be restricted to the local Intranet.

Any advice appreciated.You can't use standard dialog boxes in a webpage as these are for windows forms (well ok you can get them to work in a sense but they will only display on the server which wouldn't be any good to you).

For small messages such as 'login details not recognised' I'd just display them in a label on the page (I know as a user i'd also prefer this than rather having to close a messagebox everytime).

For application errors incorporate error handling to catch them.
Hi,

many thanks for your response.

Of course you are correct, I forgot that this will now be server based rather than client as I am used to. I didn't consider that the dialogs would appear local to the server.

I will go down the path of using alert screens/labels to return responses to the end user.

Thank you
It'll be simple. You'll use

Page.RegisterStartupScript("myalert","<script language='JavaScript'>alert('" + somevariable + "');</script>");

Saturday, March 24, 2012

Newbie Embedded WUC DLL Question

Hello -
I've been racking my brains trying to figure out what's going on with
my embedded .NET 2.0 windows user control.
I've developed a Windows Forms application using Visual C# 2005
Express. I'm interested in migrating it to the web as an embedded
windows user control.
As a proof of concept, I've been playing around embedding some very
basic Windows user controls into both HTML and ASP pages using Visual
Web Developer 2005 Express. (My web development is very limited).
I've done some searching and found examples of how to embed a user
control as an object by inserting something like the following
(<OBJECT id="myObject" classid="myDll.dll#myNamespace.myControl"
height=480 width=480></OBJECT> ) into HTML code and copying the DLL
file in the 'root' (not /bin) directory of the page.
Now here's where the fun comes in...
I'm testing some very basic embedded controls using Microsoft's
ASP.NET Development server and I'm getting some very odd and
unexplained behavior.
1) When I create a new website project and insert the control, most of
the time (but not always) my sample control will display in the
internal browser inside the Visual Web Developer IDE and it will
display in IE (as launched from the Visual Web Developer IDE in debug
mode)
2) If I change the embedded user control code (inside Visual C#
Express) and recompile and re-copy the DLL file into the web project
directory, I very rarely see the updates reflected in the user
control. It seems to be using a cached version of the DLL'
3) Eventually, I will reach a state where the user control no longer
even appears in the web browser window when trying to run the site
(using the Development Server). It only shows up as an object icon
place holder.
I've tried all sorts of things like:
1) Stopping the development server before copying the new DLL file
into the web project
2) Restarting Visual Web Developer Express
3) Deleting all the temporary IE files
4) Deleting all the files from C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\Temporary ASP.NET Files\
None of those attempts seems to change what I'm observing - why only
sometimes the embedded control displays and why none of the re-
compiles/re-copying of the DLL files seem to 'take effect'. Also,
once the control stops displaying, I essentially have to create an
entirely new web project to see the control again.
Any thoughts/links to examples or suggestions would be greatly
appreciated.
Thanks,
Mike D.the control is cached in two places
1) ie caches the dll in its temp area (use delete temp files in ie).
2) the gac caches the jit'd code. use gacutil /cdl
note: this is probably a dead-end approach. you should look at
Silverlight as a more long term solution.
-- bruce (sqlwork.com)
mdemase@.gmail.com wrote:
> Hello -
> I've been racking my brains trying to figure out what's going on with
> my embedded .NET 2.0 windows user control.
> I've developed a Windows Forms application using Visual C# 2005
> Express. I'm interested in migrating it to the web as an embedded
> windows user control.
> As a proof of concept, I've been playing around embedding some very
> basic Windows user controls into both HTML and ASP pages using Visual
> Web Developer 2005 Express. (My web development is very limited).
> I've done some searching and found examples of how to embed a user
> control as an object by inserting something like the following
> (<OBJECT id="myObject" classid="myDll.dll#myNamespace.myControl"
> height=480 width=480></OBJECT> ) into HTML code and copying the DLL
> file in the 'root' (not /bin) directory of the page.
> Now here's where the fun comes in...
> I'm testing some very basic embedded controls using Microsoft's
> ASP.NET Development server and I'm getting some very odd and
> unexplained behavior.
> 1) When I create a new website project and insert the control, most of
> the time (but not always) my sample control will display in the
> internal browser inside the Visual Web Developer IDE and it will
> display in IE (as launched from the Visual Web Developer IDE in debug
> mode)
> 2) If I change the embedded user control code (inside Visual C#
> Express) and recompile and re-copy the DLL file into the web project
> directory, I very rarely see the updates reflected in the user
> control. It seems to be using a cached version of the DLL'
> 3) Eventually, I will reach a state where the user control no longer
> even appears in the web browser window when trying to run the site
> (using the Development Server). It only shows up as an object icon
> place holder.
> I've tried all sorts of things like:
> 1) Stopping the development server before copying the new DLL file
> into the web project
> 2) Restarting Visual Web Developer Express
> 3) Deleting all the temporary IE files
> 4) Deleting all the files from C:\WINDOWS\Microsoft.NET\Framework
> \v2.0.50727\Temporary ASP.NET Files\
> None of those attempts seems to change what I'm observing - why only
> sometimes the embedded control displays and why none of the re-
> compiles/re-copying of the DLL files seem to 'take effect'. Also,
> once the control stops displaying, I essentially have to create an
> entirely new web project to see the control again.
> Any thoughts/links to examples or suggestions would be greatly
> appreciated.
> Thanks,
> Mike D.
>

Newbie Embedded WUC DLL Question

Hello -

I've been racking my brains trying to figure out what's going on with
my embedded .NET 2.0 windows user control.

I've developed a Windows Forms application using Visual C# 2005
Express. I'm interested in migrating it to the web as an embedded
windows user control.

As a proof of concept, I've been playing around embedding some very
basic Windows user controls into both HTML and ASP pages using Visual
Web Developer 2005 Express. (My web development is very limited).
I've done some searching and found examples of how to embed a user
control as an object by inserting something like the following
(<OBJECT id="myObject" classid="myDll.dll#myNamespace.myControl"
height=480 width=480></OBJECT>) into HTML code and copying the DLL
file in the 'root' (not /bin) directory of the page.

Now here's where the fun comes in...

I'm testing some very basic embedded controls using Microsoft's
ASP.NET Development server and I'm getting some very odd and
unexplained behavior.

1) When I create a new website project and insert the control, most of
the time (but not always) my sample control will display in the
internal browser inside the Visual Web Developer IDE and it will
display in IE (as launched from the Visual Web Developer IDE in debug
mode)

2) If I change the embedded user control code (inside Visual C#
Express) and recompile and re-copy the DLL file into the web project
directory, I very rarely see the updates reflected in the user
control. It seems to be using a cached version of the DLL??

3) Eventually, I will reach a state where the user control no longer
even appears in the web browser window when trying to run the site
(using the Development Server). It only shows up as an object icon
place holder.

I've tried all sorts of things like:
1) Stopping the development server before copying the new DLL file
into the web project
2) Restarting Visual Web Developer Express
3) Deleting all the temporary IE files
4) Deleting all the files from C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\Temporary ASP.NET Files\

None of those attempts seems to change what I'm observing - why only
sometimes the embedded control displays and why none of the re-
compiles/re-copying of the DLL files seem to 'take effect'. Also,
once the control stops displaying, I essentially have to create an
entirely new web project to see the control again.

Any thoughts/links to examples or suggestions would be greatly
appreciated.

Thanks,
Mike D.the control is cached in two places

1) ie caches the dll in its temp area (use delete temp files in ie).
2) the gac caches the jit'd code. use gacutil /cdl

note: this is probably a dead-end approach. you should look at
Silverlight as a more long term solution.

-- bruce (sqlwork.com)

mdemase@.gmail.com wrote:

Quote:

Originally Posted by

Hello -
>
I've been racking my brains trying to figure out what's going on with
my embedded .NET 2.0 windows user control.
>
I've developed a Windows Forms application using Visual C# 2005
Express. I'm interested in migrating it to the web as an embedded
windows user control.
>
As a proof of concept, I've been playing around embedding some very
basic Windows user controls into both HTML and ASP pages using Visual
Web Developer 2005 Express. (My web development is very limited).
I've done some searching and found examples of how to embed a user
control as an object by inserting something like the following
(<OBJECT id="myObject" classid="myDll.dll#myNamespace.myControl"
height=480 width=480></OBJECT>) into HTML code and copying the DLL
file in the 'root' (not /bin) directory of the page.
>
Now here's where the fun comes in...
>
I'm testing some very basic embedded controls using Microsoft's
ASP.NET Development server and I'm getting some very odd and
unexplained behavior.
>
1) When I create a new website project and insert the control, most of
the time (but not always) my sample control will display in the
internal browser inside the Visual Web Developer IDE and it will
display in IE (as launched from the Visual Web Developer IDE in debug
mode)
>
2) If I change the embedded user control code (inside Visual C#
Express) and recompile and re-copy the DLL file into the web project
directory, I very rarely see the updates reflected in the user
control. It seems to be using a cached version of the DLL??
>
3) Eventually, I will reach a state where the user control no longer
even appears in the web browser window when trying to run the site
(using the Development Server). It only shows up as an object icon
place holder.
>
I've tried all sorts of things like:
1) Stopping the development server before copying the new DLL file
into the web project
2) Restarting Visual Web Developer Express
3) Deleting all the temporary IE files
4) Deleting all the files from C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\Temporary ASP.NET Files\
>
None of those attempts seems to change what I'm observing - why only
sometimes the embedded control displays and why none of the re-
compiles/re-copying of the DLL files seem to 'take effect'. Also,
once the control stops displaying, I essentially have to create an
entirely new web project to see the control again.
>
Any thoughts/links to examples or suggestions would be greatly
appreciated.
>
Thanks,
Mike D.
>

Thursday, March 22, 2012

Newbie IIS6/ASP.net problem

Yesterday I installed Windows Server 2003 onto a computer for testing and
development. I then chose the Application server role and loaded IIS 6
making sure to enable ASP.NET while I was doing it. I then installed Visual
Studio.NET 2003. Today I was loading some sample files from a C# book I got
from Microsoft Press and got this error from the Windows Development
Environment:

"The Web server reported the following error when attempting to create or
open the web project located at the following URL:
'http://Localhost:/aspnetsbs_cs/Chapter_01/'.'HTTP/1.1 400 Bad Request'.

When I loaded the same sample files on my Win2k Pro machine it came off
without a hitch. I have scoured Microsoft Technet but I seem to be unable to
find anything to explain this. So far I have not been able to get any
classic ASP or ASP.NET pages to run.

If anyone can give me some pointers I would really appreciate it. I imagine,
as usual, that the answer is quite simple. Obviously I am very inexperienced
with IIS and .NET. I usually do MSAccess programming.If nothing runs, open the IIS Administration Console on the Server. Expand
the local computer node, and click on Web Service Extensions. In the right
pane, make sure Active Server Pages and ASP.NET are set to "Allow". Windows
Server 2003, as part of the new security initiative, now disables many
things by default.

--
James J. Foster, DotNetCoders
http://www.dotnetcoders.com

"Michael Kelty" <mkelty@.hotmail.com> wrote in message
news:befe00$bnv$1@.news1.radix.net...
> Yesterday I installed Windows Server 2003 onto a computer for testing and
> development. I then chose the Application server role and loaded IIS 6
> making sure to enable ASP.NET while I was doing it. I then installed
Visual
> Studio.NET 2003. Today I was loading some sample files from a C# book I
got
> from Microsoft Press and got this error from the Windows Development
> Environment:
> "The Web server reported the following error when attempting to create or
> open the web project located at the following URL:
> 'http://Localhost:/aspnetsbs_cs/Chapter_01/'.'HTTP/1.1 400 Bad Request'.
> When I loaded the same sample files on my Win2k Pro machine it came off
> without a hitch. I have scoured Microsoft Technet but I seem to be unable
to
> find anything to explain this. So far I have not been able to get any
> classic ASP or ASP.NET pages to run.
> If anyone can give me some pointers I would really appreciate it. I
imagine,
> as usual, that the answer is quite simple. Obviously I am very
inexperienced
> with IIS and .NET. I usually do MSAccess programming.
>
"James J. Foster" <james@.dotnetcoders.com> wrote in message
news:%23CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl...
> If nothing runs, open the IIS Administration Console on the Server. Expand
> the local computer node, and click on Web Service Extensions. In the right
> pane, make sure Active Server Pages and ASP.NET are set to "Allow".
Windows
> Server 2003, as part of the new security initiative, now disables many
> things by default.
> --
> James J. Foster, DotNetCoders
> http://www.dotnetcoders.com

Thanks but the Server console is set to "Allow" for both Active Server Pages
and ASP.NET. I'm still at a standstill without a clue.

Perhaps bagging the idea of using Win2k3 and IIS 6 altogether and going with
Windows 2000 server would be better, no? The site I am eventually going to
set up will be in an intranet setting so security shouldn't be too much of a
problem (famous last words).

> "Michael Kelty" <mkelty@.hotmail.com> wrote in message
> news:befe00$bnv$1@.news1.radix.net...
> > Yesterday I installed Windows Server 2003 onto a computer for testing
and
> > development. I then chose the Application server role and loaded IIS 6
> > making sure to enable ASP.NET while I was doing it. I then installed
> Visual
> > Studio.NET 2003. Today I was loading some sample files from a C# book I
> got
> > from Microsoft Press and got this error from the Windows Development
> > Environment:
> > "The Web server reported the following error when attempting to create
or
> > open the web project located at the following URL:
> > 'http://Localhost:/aspnetsbs_cs/Chapter_01/'.'HTTP/1.1 400 Bad Request'.
> > When I loaded the same sample files on my Win2k Pro machine it came off
> > without a hitch. I have scoured Microsoft Technet but I seem to be
unable
> to
> > find anything to explain this. So far I have not been able to get any
> > classic ASP or ASP.NET pages to run.
> > If anyone can give me some pointers I would really appreciate it. I
> imagine,
> > as usual, that the answer is quite simple. Obviously I am very
> inexperienced
> > with IIS and .NET. I usually do MSAccess programming.
Hi Michael,

Please go to IIS configuration->Default web site->Properties->select "web
site" tab. There is a IP address setting. Did you set it to an IP address?
If so, please change it back to (all unassigned).

If this setting is set as an IP address, then localhost(127.0.0.1) can't be
resolved by IIS and so you couldn't visit any site in http://localhost.

Please post here if the problem is not resolved. Thanks.

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
-------
!From: "Michael Kelty" <mkelty@.hotmail.com>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Subject: Re: Newbie IIS6/ASP.net problem
!Date: Wed, 9 Jul 2003 10:32:18 -0400
!Organization: RadixNet Internet Services
!Lines: 60
!Message-ID: <beh91k$4i$1@.news1.radix.net>
!References: <befe00$bnv$1@.news1.radix.net>
<#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl>
!NNTP-Posting-Host: ip5.ci.alexandria.va.us
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!npeer.de.kpn-eurorings.net!news-out.nuthinbutnews.com!propagator2-sterl
ing!news-in-sterling.newsfeed.com!tdsnet-transit!newspeer.tds.net!newspeer.r
adix.net!news1.radix.net!not-for-mail
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:158011
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!
!"James J. Foster" <james@.dotnetcoders.com> wrote in message
!news:%23CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl...
!> If nothing runs, open the IIS Administration Console on the Server.
Expand
!> the local computer node, and click on Web Service Extensions. In the
right
!> pane, make sure Active Server Pages and ASP.NET are set to "Allow".
!Windows
!> Server 2003, as part of the new security initiative, now disables many
!> things by default.
!>
!> --
!> James J. Foster, DotNetCoders
!> http://www.dotnetcoders.com
!
!Thanks but the Server console is set to "Allow" for both Active Server
Pages
!and ASP.NET. I'm still at a standstill without a clue.
!
!Perhaps bagging the idea of using Win2k3 and IIS 6 altogether and going
with
!Windows 2000 server would be better, no? The site I am eventually going to
!set up will be in an intranet setting so security shouldn't be too much of
a
!problem (famous last words).
!
!
!> "Michael Kelty" <mkelty@.hotmail.com> wrote in message
!> news:befe00$bnv$1@.news1.radix.net...
!> > Yesterday I installed Windows Server 2003 onto a computer for testing
!and
!> > development. I then chose the Application server role and loaded IIS 6
!> > making sure to enable ASP.NET while I was doing it. I then installed
!> Visual
!> > Studio.NET 2003. Today I was loading some sample files from a C# book I
!> got
!> > from Microsoft Press and got this error from the Windows Development
!> > Environment:
!!> > "The Web server reported the following error when attempting to create
!or
!> > open the web project located at the following URL:
!> > 'http://Localhost:/aspnetsbs_cs/Chapter_01/'.'HTTP/1.1 400 Bad
Request'.
!!> > When I loaded the same sample files on my Win2k Pro machine it came off
!> > without a hitch. I have scoured Microsoft Technet but I seem to be
!unable
!> to
!> > find anything to explain this. So far I have not been able to get any
!> > classic ASP or ASP.NET pages to run.
!!> > If anyone can give me some pointers I would really appreciate it. I
!> imagine,
!> > as usual, that the answer is quite simple. Obviously I am very
!> inexperienced
!> > with IIS and .NET. I usually do MSAccess programming.
!!!!!>
!>
!
!
!
"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
> Hi Michael,
> Please go to IIS configuration->Default web site->Properties->select "web
> site" tab. There is a IP address setting. Did you set it to an IP address?
> If so, please change it back to (all unassigned).
> If this setting is set as an IP address, then localhost(127.0.0.1) can't
be
> resolved by IIS and so you couldn't visit any site in http://localhost.
> Please post here if the problem is not resolved. Thanks.
> Best regards,
> yhhuang
> VS.NET, Visual C++
> Microsoft

I did as you said and now the error I get is the same except instead of
saying 'Bad Request' it says 'Service Unavailable'. During the course of
trying to get the webserver up and running, I got an error page in IE with
those words on it on several occasions but all the indications that I could
see led me to believe that the website was running.

Sorry to truncate but the thread was getting quite long.
Continuing thanks.
Hi Michael,

Could you creaet a new asp.net web application from application wizard successfully? If not, I think you need to reinstall
asp.net in the system. Please refer to http://support.microsoft.com/?id=306005 for detailed steps. Thanks.

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
-------
!From: "Michael Kelty" <mkelty@.hotmail.com>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Subject: Re: Newbie IIS6/ASP.net problem
!Date: Thu, 10 Jul 2003 14:17:01 -0400
!Organization: RadixNet Internet Services
!Lines: 30
!Message-ID: <bekaiu$k5r$1@.news1.radix.net>
!References: <befe00$bnv$1@.news1.radix.net> <#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl> <beh91k$4i$1
@.news1.radix.net> <oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl>
!NNTP-Posting-Host: ip5.ci.alexandria.va.us
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!tdsnet-transit!newspeer.tds.net!
newspeer.radix.net!news1.radix.net!not-for-mail
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:158373
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!
!"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
!news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
!> Hi Michael,
!>
!> Please go to IIS configuration->Default web site->Properties->select "web
!> site" tab. There is a IP address setting. Did you set it to an IP address?
!> If so, please change it back to (all unassigned).
!>
!> If this setting is set as an IP address, then localhost(127.0.0.1) can't
!be
!> resolved by IIS and so you couldn't visit any site in http://localhost.
!>
!> Please post here if the problem is not resolved. Thanks.
!>
!> Best regards,
!> yhhuang
!> VS.NET, Visual C++
!> Microsoft
!
!I did as you said and now the error I get is the same except instead of
!saying 'Bad Request' it says 'Service Unavailable'. During the course of
!trying to get the webserver up and running, I got an error page in IE with
!those words on it on several occasions but all the indications that I could
!see led me to believe that the website was running.
!
!Sorry to truncate but the thread was getting quite long.
!Continuing thanks.
!
!
!
Hi Michael,

Could you creaet a new asp.net web application from application wizard successfully? If not, I think you need to reinstall
asp.net in the system. Please refer to http://support.microsoft.com/?id=306005 for detailed steps. Thanks.

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
-------
!From: "Michael Kelty" <mkelty@.hotmail.com>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Subject: Re: Newbie IIS6/ASP.net problem
!Date: Thu, 10 Jul 2003 14:17:01 -0400
!Organization: RadixNet Internet Services
!Lines: 30
!Message-ID: <bekaiu$k5r$1@.news1.radix.net>
!References: <befe00$bnv$1@.news1.radix.net> <#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl> <beh91k$4i$1
@.news1.radix.net> <oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl>
!NNTP-Posting-Host: ip5.ci.alexandria.va.us
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!tdsnet-transit!newspeer.tds.net!
newspeer.radix.net!news1.radix.net!not-for-mail
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:158373
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!
!"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
!news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
!> Hi Michael,
!>
!> Please go to IIS configuration->Default web site->Properties->select "web
!> site" tab. There is a IP address setting. Did you set it to an IP address?
!> If so, please change it back to (all unassigned).
!>
!> If this setting is set as an IP address, then localhost(127.0.0.1) can't
!be
!> resolved by IIS and so you couldn't visit any site in http://localhost.
!>
!> Please post here if the problem is not resolved. Thanks.
!>
!> Best regards,
!> yhhuang
!> VS.NET, Visual C++
!> Microsoft
!
!I did as you said and now the error I get is the same except instead of
!saying 'Bad Request' it says 'Service Unavailable'. During the course of
!trying to get the webserver up and running, I got an error page in IE with
!those words on it on several occasions but all the indications that I could
!see led me to believe that the website was running.
!
!Sorry to truncate but the thread was getting quite long.
!Continuing thanks.
!
!
!
Excellent, thank you.
"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
news:brtQ3afSDHA.1928@.cpmsftngxa06.phx.gbl...
> Hi Michael,
> Could you creaet a new asp.net web application from application wizard
successfully? If not, I think you need to reinstall
> asp.net in the system. Please refer to
http://support.microsoft.com/?id=306005 for detailed steps. Thanks.
> Best regards,
> yhhuang
> VS.NET, Visual C++
> Microsoft
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Got .Net? http://www.gotdotnet.com
> -------
> !From: "Michael Kelty" <mkelty@.hotmail.com>
> !Newsgroups: microsoft.public.dotnet.framework.aspnet
> !Subject: Re: Newbie IIS6/ASP.net problem
> !Date: Thu, 10 Jul 2003 14:17:01 -0400
> !Organization: RadixNet Internet Services
> !Lines: 30
> !Message-ID: <bekaiu$k5r$1@.news1.radix.net>
> !References: <befe00$bnv$1@.news1.radix.net>
<#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl> <beh91k$4i$1
> @.news1.radix.net> <oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl>
> !NNTP-Posting-Host: ip5.ci.alexandria.va.us
> !X-Priority: 3
> !X-MSMail-Priority: Normal
> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> !Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!tdsne
t-transit!newspeer.tds.net!
> newspeer.radix.net!news1.radix.net!not-for-mail
> !Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet:158373
> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> !
> !
> !"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
> !news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
> !> Hi Michael,
> !>
> !> Please go to IIS configuration->Default web site->Properties->select
"web
> !> site" tab. There is a IP address setting. Did you set it to an IP
address?
> !> If so, please change it back to (all unassigned).
> !>
> !> If this setting is set as an IP address, then localhost(127.0.0.1)
can't
> !be
> !> resolved by IIS and so you couldn't visit any site in http://localhost.
> !>
> !> Please post here if the problem is not resolved. Thanks.
> !>
> !> Best regards,
> !> yhhuang
> !> VS.NET, Visual C++
> !> Microsoft
> !
> !I did as you said and now the error I get is the same except instead of
> !saying 'Bad Request' it says 'Service Unavailable'. During the course of
> !trying to get the webserver up and running, I got an error page in IE
with
> !those words on it on several occasions but all the indications that I
could
> !see led me to believe that the website was running.
> !
> !Sorry to truncate but the thread was getting quite long.
> !Continuing thanks.
> !
> !
> !
Excellent, thank you.
"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
news:brtQ3afSDHA.1928@.cpmsftngxa06.phx.gbl...
> Hi Michael,
> Could you creaet a new asp.net web application from application wizard
successfully? If not, I think you need to reinstall
> asp.net in the system. Please refer to
http://support.microsoft.com/?id=306005 for detailed steps. Thanks.
> Best regards,
> yhhuang
> VS.NET, Visual C++
> Microsoft
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Got .Net? http://www.gotdotnet.com
> -------
> !From: "Michael Kelty" <mkelty@.hotmail.com>
> !Newsgroups: microsoft.public.dotnet.framework.aspnet
> !Subject: Re: Newbie IIS6/ASP.net problem
> !Date: Thu, 10 Jul 2003 14:17:01 -0400
> !Organization: RadixNet Internet Services
> !Lines: 30
> !Message-ID: <bekaiu$k5r$1@.news1.radix.net>
> !References: <befe00$bnv$1@.news1.radix.net>
<#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl> <beh91k$4i$1
> @.news1.radix.net> <oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl>
> !NNTP-Posting-Host: ip5.ci.alexandria.va.us
> !X-Priority: 3
> !X-MSMail-Priority: Normal
> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> !Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!tdsne
t-transit!newspeer.tds.net!
> newspeer.radix.net!news1.radix.net!not-for-mail
> !Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet:158373
> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> !
> !
> !"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
> !news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
> !> Hi Michael,
> !>
> !> Please go to IIS configuration->Default web site->Properties->select
"web
> !> site" tab. There is a IP address setting. Did you set it to an IP
address?
> !> If so, please change it back to (all unassigned).
> !>
> !> If this setting is set as an IP address, then localhost(127.0.0.1)
can't
> !be
> !> resolved by IIS and so you couldn't visit any site in http://localhost.
> !>
> !> Please post here if the problem is not resolved. Thanks.
> !>
> !> Best regards,
> !> yhhuang
> !> VS.NET, Visual C++
> !> Microsoft
> !
> !I did as you said and now the error I get is the same except instead of
> !saying 'Bad Request' it says 'Service Unavailable'. During the course of
> !trying to get the webserver up and running, I got an error page in IE
with
> !those words on it on several occasions but all the indications that I
could
> !see led me to believe that the website was running.
> !
> !Sorry to truncate but the thread was getting quite long.
> !Continuing thanks.
> !
> !
> !

Friday, March 16, 2012

Newbie needs code pages for SQL Server 2000 access from asp.net page using vb.net


I am only trying to connect to a local host .
I am on Windows 2000 Server with sql 2000 server.

My error is the classic "SQL server does not exist or access denied"
I went to the MS site & they tell me what I know....."some" permissioning
issue.

I had this code working 2 months ago on a different server but now I cannot
get it going now on a different
machine

I can setup ODBC connections every which way to this local server using
Integrated mode access
using different connectivity methods such as by using "local" or
<machinename> or 127.0.0.1 or <machine IP address>. I can also connect
using SQL authentication for user sa or some other new user I created.
So I am not sure about this access denied BS.

I need to connect to Northwind & pubs dbs (the sample dbs that come with sql
2000)
Please post the complete page in (without code behind crap for now).

I went to different sites & they have partial code & they cause different
errors ( I am not a Vb.net guru)

The page I used is something similar to below.

I am just trying to connect & print the server name & SQL version etc

'================
Sub Page_Load(Source As Object, E As EventArgs)

Dim strConnection1 As String = "server=localhost; database=Northwind; " & _

"integrated security=true"

Dim objConnection As New SqlConnection(strConnection)

Dim strSQL As String = "SELECT FirstName, LastName, Country " & _

"FROM Employees;"

Dim objCommand As New SqlCommand(strSQL, objConnection)

objConnection.Open()

Response.Write("ServerVersion: " & objConnection.ServerVersion & _

vbCRLF & "Datasource: " & objConnection.DataSource & _

vbCRLF & "Database: " & objConnection.Database)

dgNameList.DataSource = objCommand.ExecuteReader()

dgNameList.DataBind()

objConnection.Close()

End Sub

'==================

Can someone tell me what is wrong & also ALL the authentication settings
step by step I need in Windows 2000 server / SQL 2000 server ?
This is just the freaking local machine & server. I cannot believe this is
so hard.
Last time someone in some newsgroup had me play with registry settings to
make this work
in addition to some other Windows 2000 user changes
(Sorry I did not save it ...did not know this would be so bad)

I would prefer a complete code page that does both Integrated Auth (as
above) and also
SQL auth (using Username / PW).
(I know the actual call is a one or two line code but the exact format
without syntax or other errors is the key)

I don't have VS-7 so I cannot drag & drop the SQL connector control as
someone suggested.Lori,

When you are connecting to SQL server in integrated security mode IIS is
passing SQL server the account used to run the website. If you haven't
changed the web site to use impersonation (you would do that in the
web.config file) then the site is passing SQL server the anonymous login
account which the website would normally run under. Depending on your needs
their are multiple ways to configure this.

Here's a good article to get you started:

http://support.microsoft.com/defaul...B;EN-US;q176378

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche

"Lori" <__--LoriG--_@.yahoo.com> wrote in message
news:bjpt0d$li3vt$1@.ID-158805.news.uni-berlin.de...
>
> I am only trying to connect to a local host .
> I am on Windows 2000 Server with sql 2000 server.
>
> My error is the classic "SQL server does not exist or access denied"
> I went to the MS site & they tell me what I know....."some" permissioning
> issue.
> I had this code working 2 months ago on a different server but now I
cannot
> get it going now on a different
> machine
> I can setup ODBC connections every which way to this local server using
> Integrated mode access
> using different connectivity methods such as by using "local" or
> <machinename> or 127.0.0.1 or <machine IP address>. I can also connect
> using SQL authentication for user sa or some other new user I created.
> So I am not sure about this access denied BS.
> I need to connect to Northwind & pubs dbs (the sample dbs that come with
sql
> 2000)
> Please post the complete page in (without code behind crap for now).
> I went to different sites & they have partial code & they cause different
> errors ( I am not a Vb.net guru)
> The page I used is something similar to below.
> I am just trying to connect & print the server name & SQL version etc
> '================
> Sub Page_Load(Source As Object, E As EventArgs)
> Dim strConnection1 As String = "server=localhost; database=Northwind; " &
_
> "integrated security=true"
> Dim objConnection As New SqlConnection(strConnection)
> Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
> "FROM Employees;"
> Dim objCommand As New SqlCommand(strSQL, objConnection)
> objConnection.Open()
> Response.Write("ServerVersion: " & objConnection.ServerVersion & _
> vbCRLF & "Datasource: " & objConnection.DataSource & _
> vbCRLF & "Database: " & objConnection.Database)
> dgNameList.DataSource = objCommand.ExecuteReader()
> dgNameList.DataBind()
> objConnection.Close()
> End Sub
> '==================
> Can someone tell me what is wrong & also ALL the authentication settings
> step by step I need in Windows 2000 server / SQL 2000 server ?
> This is just the freaking local machine & server. I cannot believe this is
> so hard.
> Last time someone in some newsgroup had me play with registry settings to
> make this work
> in addition to some other Windows 2000 user changes
> (Sorry I did not save it ...did not know this would be so bad)
> I would prefer a complete code page that does both Integrated Auth (as
> above) and also
> SQL auth (using Username / PW).
> (I know the actual call is a one or two line code but the exact format
> without syntax or other errors is the key)
>
> I don't have VS-7 so I cannot drag & drop the SQL connector control as
> someone suggested.
>
>
"S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
news:eNMgDwGeDHA.1748@.TK2MSFTNGP10.phx.gbl...

> If you haven't
> changed the web site to use impersonation (you would do that in the
> web.config file) then the site is passing SQL server the anonymous login
> account which the website would normally run under.

I have no idea what you mean. Is there an error in logic such as your
sttement should read

======================
> If you haven't
> changed the web site to use impersonation (you would do that in the
> web.config file) then the site is NOT passing SQL server the anonymous
login
> account which the website would normally run under
=============================

> Depending on your needs
> their are multiple ways to configure this.
> Here's a good article to get you started:
> http://support.microsoft.com/defaul...B;EN-US;q176378

The above site shows how to do a DSN connection.
I already said I am able to do a DSN conncection (but am not using it)

If you look at my sample code, it is a DSNless conncection, is it not ?
And another thing.
The Microsoft error message is so misleading.
If there is a problem with IIS permissions why the hell does it say
"SQL server does not exist ?" Very helpful if troubleshooting is it not , by
misleading you ?
Also "access denied" by whom by SQL server ? By 2000 Server ? By IIS ?
Can they be anymore vague ?

"S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
news:eNMgDwGeDHA.1748@.TK2MSFTNGP10.phx.gbl...
> Lori,
> When you are connecting to SQL server in integrated security mode IIS is
> passing SQL server the account used to run the website. If you haven't
> changed the web site to use impersonation (you would do that in the
> web.config file) then the site is passing SQL server the anonymous login
> account which the website would normally run under. Depending on your
needs
> their are multiple ways to configure this.
> Here's a good article to get you started:
> http://support.microsoft.com/defaul...B;EN-US;q176378
> Sincerely,
> --
> S. Justin Gengo, MCP
> Web Developer
> Free code library at:
> www.aboutfortunate.com
> "Out of chaos comes order."
> Nietzche
>
> "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> news:bjpt0d$li3vt$1@.ID-158805.news.uni-berlin.de...
> > I am only trying to connect to a local host .
> > I am on Windows 2000 Server with sql 2000 server.
> > My error is the classic "SQL server does not exist or access denied"
> > I went to the MS site & they tell me what I know....."some"
permissioning
> > issue.
> > I had this code working 2 months ago on a different server but now I
> cannot
> > get it going now on a different
> > machine
> > I can setup ODBC connections every which way to this local server using
> > Integrated mode access
> > using different connectivity methods such as by using "local" or
> > <machinename> or 127.0.0.1 or <machine IP address>. I can also connect
> > using SQL authentication for user sa or some other new user I created.
> > So I am not sure about this access denied BS.
> > I need to connect to Northwind & pubs dbs (the sample dbs that come with
> sql
> > 2000)
> > Please post the complete page in (without code behind crap for now).
> > I went to different sites & they have partial code & they cause
different
> > errors ( I am not a Vb.net guru)
> > The page I used is something similar to below.
> > I am just trying to connect & print the server name & SQL version etc
> > '================
> > Sub Page_Load(Source As Object, E As EventArgs)
> > Dim strConnection1 As String = "server=localhost; database=Northwind; "
&
> _
> > "integrated security=true"
> > Dim objConnection As New SqlConnection(strConnection)
> > Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
> > "FROM Employees;"
> > Dim objCommand As New SqlCommand(strSQL, objConnection)
> > objConnection.Open()
> > Response.Write("ServerVersion: " & objConnection.ServerVersion & _
> > vbCRLF & "Datasource: " & objConnection.DataSource & _
> > vbCRLF & "Database: " & objConnection.Database)
> > dgNameList.DataSource = objCommand.ExecuteReader()
> > dgNameList.DataBind()
> > objConnection.Close()
> > End Sub
> > '==================
> > Can someone tell me what is wrong & also ALL the authentication settings
> > step by step I need in Windows 2000 server / SQL 2000 server ?
> > This is just the freaking local machine & server. I cannot believe this
is
> > so hard.
> > Last time someone in some newsgroup had me play with registry settings
to
> > make this work
> > in addition to some other Windows 2000 user changes
> > (Sorry I did not save it ...did not know this would be so bad)
> > I would prefer a complete code page that does both Integrated Auth (as
> > above) and also
> > SQL auth (using Username / PW).
> > (I know the actual call is a one or two line code but the exact format
> > without syntax or other errors is the key)
> > I don't have VS-7 so I cannot drag & drop the SQL connector control as
> > someone suggested.
What I am trying say is this
It would make more sense if the error message described that permission was
denied at one of the
possible 3 layers . Even the KB article does not make any references to the
IIS layer.

That said, I am not sure what user to add where in IIS

And another thing.
How would the SQL Auth. work ? Does it not go thru IIS also anyway,
regardless ?

"Lori" <__--LoriG--_@.yahoo.com> wrote in message
news:bjq07b$ljgdk$1@.ID-158805.news.uni-berlin.de...
> And another thing.
> The Microsoft error message is so misleading.
> If there is a problem with IIS permissions why the hell does it say
> "SQL server does not exist ?" Very helpful if troubleshooting is it not ,
by
> misleading you ?
> Also "access denied" by whom by SQL server ? By 2000 Server ? By IIS ?
> Can they be anymore vague ?
> "S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
> news:eNMgDwGeDHA.1748@.TK2MSFTNGP10.phx.gbl...
> > Lori,
> > When you are connecting to SQL server in integrated security mode IIS is
> > passing SQL server the account used to run the website. If you haven't
> > changed the web site to use impersonation (you would do that in the
> > web.config file) then the site is passing SQL server the anonymous login
> > account which the website would normally run under. Depending on your
> needs
> > their are multiple ways to configure this.
> > Here's a good article to get you started:
> > http://support.microsoft.com/defaul...B;EN-US;q176378
> > Sincerely,
> > --
> > S. Justin Gengo, MCP
> > Web Developer
> > Free code library at:
> > www.aboutfortunate.com
> > "Out of chaos comes order."
> > Nietzche
> > "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> > news:bjpt0d$li3vt$1@.ID-158805.news.uni-berlin.de...
> > > > > I am only trying to connect to a local host .
> > > I am on Windows 2000 Server with sql 2000 server.
> > > > > My error is the classic "SQL server does not exist or access denied"
> > > I went to the MS site & they tell me what I know....."some"
> permissioning
> > > issue.
> > > > I had this code working 2 months ago on a different server but now I
> > cannot
> > > get it going now on a different
> > > machine
> > > > I can setup ODBC connections every which way to this local server
using
> > > Integrated mode access
> > > using different connectivity methods such as by using "local" or
> > > <machinename> or 127.0.0.1 or <machine IP address>. I can also
connect
> > > using SQL authentication for user sa or some other new user I created.
> > > So I am not sure about this access denied BS.
> > > > I need to connect to Northwind & pubs dbs (the sample dbs that come
with
> > sql
> > > 2000)
> > > Please post the complete page in (without code behind crap for now).
> > > > I went to different sites & they have partial code & they cause
> different
> > > errors ( I am not a Vb.net guru)
> > > > The page I used is something similar to below.
> > > > I am just trying to connect & print the server name & SQL version etc
> > > > '================
> > > Sub Page_Load(Source As Object, E As EventArgs)
> > > > Dim strConnection1 As String = "server=localhost; database=Northwind;
"
> &
> > _
> > > > "integrated security=true"
> > > > Dim objConnection As New SqlConnection(strConnection)
> > > > Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
> > > > "FROM Employees;"
> > > > Dim objCommand As New SqlCommand(strSQL, objConnection)
> > > > objConnection.Open()
> > > > Response.Write("ServerVersion: " & objConnection.ServerVersion & _
> > > > vbCRLF & "Datasource: " & objConnection.DataSource & _
> > > > vbCRLF & "Database: " & objConnection.Database)
> > > > dgNameList.DataSource = objCommand.ExecuteReader()
> > > > dgNameList.DataBind()
> > > > objConnection.Close()
> > > > End Sub
> > > > '==================
> > > > Can someone tell me what is wrong & also ALL the authentication
settings
> > > step by step I need in Windows 2000 server / SQL 2000 server ?
> > > This is just the freaking local machine & server. I cannot believe
this
> is
> > > so hard.
> > > Last time someone in some newsgroup had me play with registry
settings
> to
> > > make this work
> > > in addition to some other Windows 2000 user changes
> > > (Sorry I did not save it ...did not know this would be so bad)
> > > > I would prefer a complete code page that does both Integrated Auth (as
> > > above) and also
> > > SQL auth (using Username / PW).
> > > (I know the actual call is a one or two line code but the exact format
> > > without syntax or other errors is the key)
> > > > > I don't have VS-7 so I cannot drag & drop the SQL connector control as
> > > someone suggested.
> > > > > > >
Lori,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche

"Lori" <__--LoriG--_@.yahoo.com> wrote in message
news:bjq07b$ljgdk$1@.ID-158805.news.uni-berlin.de...
> And another thing.
> The Microsoft error message is so misleading.
> If there is a problem with IIS permissions why the hell does it say
> "SQL server does not exist ?" Very helpful if troubleshooting is it not ,
by
> misleading you ?
> Also "access denied" by whom by SQL server ? By 2000 Server ? By IIS ?
> Can they be anymore vague ?
> "S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
> news:eNMgDwGeDHA.1748@.TK2MSFTNGP10.phx.gbl...
> > Lori,
> > When you are connecting to SQL server in integrated security mode IIS is
> > passing SQL server the account used to run the website. If you haven't
> > changed the web site to use impersonation (you would do that in the
> > web.config file) then the site is passing SQL server the anonymous login
> > account which the website would normally run under. Depending on your
> needs
> > their are multiple ways to configure this.
> > Here's a good article to get you started:
> > http://support.microsoft.com/defaul...B;EN-US;q176378
> > Sincerely,
> > --
> > S. Justin Gengo, MCP
> > Web Developer
> > Free code library at:
> > www.aboutfortunate.com
> > "Out of chaos comes order."
> > Nietzche
> > "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> > news:bjpt0d$li3vt$1@.ID-158805.news.uni-berlin.de...
> > > > > I am only trying to connect to a local host .
> > > I am on Windows 2000 Server with sql 2000 server.
> > > > > My error is the classic "SQL server does not exist or access denied"
> > > I went to the MS site & they tell me what I know....."some"
> permissioning
> > > issue.
> > > > I had this code working 2 months ago on a different server but now I
> > cannot
> > > get it going now on a different
> > > machine
> > > > I can setup ODBC connections every which way to this local server
using
> > > Integrated mode access
> > > using different connectivity methods such as by using "local" or
> > > <machinename> or 127.0.0.1 or <machine IP address>. I can also
connect
> > > using SQL authentication for user sa or some other new user I created.
> > > So I am not sure about this access denied BS.
> > > > I need to connect to Northwind & pubs dbs (the sample dbs that come
with
> > sql
> > > 2000)
> > > Please post the complete page in (without code behind crap for now).
> > > > I went to different sites & they have partial code & they cause
> different
> > > errors ( I am not a Vb.net guru)
> > > > The page I used is something similar to below.
> > > > I am just trying to connect & print the server name & SQL version etc
> > > > '================
> > > Sub Page_Load(Source As Object, E As EventArgs)
> > > > Dim strConnection1 As String = "server=localhost; database=Northwind;
"
> &
> > _
> > > > "integrated security=true"
> > > > Dim objConnection As New SqlConnection(strConnection)
> > > > Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
> > > > "FROM Employees;"
> > > > Dim objCommand As New SqlCommand(strSQL, objConnection)
> > > > objConnection.Open()
> > > > Response.Write("ServerVersion: " & objConnection.ServerVersion & _
> > > > vbCRLF & "Datasource: " & objConnection.DataSource & _
> > > > vbCRLF & "Database: " & objConnection.Database)
> > > > dgNameList.DataSource = objCommand.ExecuteReader()
> > > > dgNameList.DataBind()
> > > > objConnection.Close()
> > > > End Sub
> > > > '==================
> > > > Can someone tell me what is wrong & also ALL the authentication
settings
> > > step by step I need in Windows 2000 server / SQL 2000 server ?
> > > This is just the freaking local machine & server. I cannot believe
this
> is
> > > so hard.
> > > Last time someone in some newsgroup had me play with registry
settings
> to
> > > make this work
> > > in addition to some other Windows 2000 user changes
> > > (Sorry I did not save it ...did not know this would be so bad)
> > > > I would prefer a complete code page that does both Integrated Auth (as
> > > above) and also
> > > SQL auth (using Username / PW).
> > > (I know the actual call is a one or two line code but the exact format
> > > without syntax or other errors is the key)
> > > > > I don't have VS-7 so I cannot drag & drop the SQL connector control as
> > > someone suggested.
> > > > > > >
Lori,

Sorry about that link. I copied and pasted the wrong one from my list.

Here's the right one:

http://msdn.microsoft.com/library/d.../secnetch12.asp

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche

"Lori" <__--LoriG--_@.yahoo.com> wrote in message
news:bjq0u6$kldqf$1@.ID-158805.news.uni-berlin.de...
> What I am trying say is this
> It would make more sense if the error message described that permission
was
> denied at one of the
> possible 3 layers . Even the KB article does not make any references to
the
> IIS layer.
> That said, I am not sure what user to add where in IIS
> And another thing.
> How would the SQL Auth. work ? Does it not go thru IIS also anyway,
> regardless ?
>
> "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> news:bjq07b$ljgdk$1@.ID-158805.news.uni-berlin.de...
> > And another thing.
> > The Microsoft error message is so misleading.
> > If there is a problem with IIS permissions why the hell does it say
> > "SQL server does not exist ?" Very helpful if troubleshooting is it not
,
> by
> > misleading you ?
> > Also "access denied" by whom by SQL server ? By 2000 Server ? By IIS ?
> > Can they be anymore vague ?
> > "S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
> > news:eNMgDwGeDHA.1748@.TK2MSFTNGP10.phx.gbl...
> > > Lori,
> > > > When you are connecting to SQL server in integrated security mode IIS
is
> > > passing SQL server the account used to run the website. If you haven't
> > > changed the web site to use impersonation (you would do that in the
> > > web.config file) then the site is passing SQL server the anonymous
login
> > > account which the website would normally run under. Depending on your
> > needs
> > > their are multiple ways to configure this.
> > > > Here's a good article to get you started:
> > > > http://support.microsoft.com/defaul...B;EN-US;q176378
> > > > Sincerely,
> > > > --
> > > S. Justin Gengo, MCP
> > > Web Developer
> > > > Free code library at:
> > > www.aboutfortunate.com
> > > > "Out of chaos comes order."
> > > Nietzche
> > > > > "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> > > news:bjpt0d$li3vt$1@.ID-158805.news.uni-berlin.de...
> > > > > > > > I am only trying to connect to a local host .
> > > > I am on Windows 2000 Server with sql 2000 server.
> > > > > > > > My error is the classic "SQL server does not exist or access denied"
> > > > I went to the MS site & they tell me what I know....."some"
> > permissioning
> > > > issue.
> > > > > > I had this code working 2 months ago on a different server but now I
> > > cannot
> > > > get it going now on a different
> > > > machine
> > > > > > I can setup ODBC connections every which way to this local server
> using
> > > > Integrated mode access
> > > > using different connectivity methods such as by using "local" or
> > > > <machinename> or 127.0.0.1 or <machine IP address>. I can also
> connect
> > > > using SQL authentication for user sa or some other new user I
created.
> > > > So I am not sure about this access denied BS.
> > > > > > I need to connect to Northwind & pubs dbs (the sample dbs that come
> with
> > > sql
> > > > 2000)
> > > > Please post the complete page in (without code behind crap for now).
> > > > > > I went to different sites & they have partial code & they cause
> > different
> > > > errors ( I am not a Vb.net guru)
> > > > > > The page I used is something similar to below.
> > > > > > I am just trying to connect & print the server name & SQL version
etc
> > > > > > '================
> > > > Sub Page_Load(Source As Object, E As EventArgs)
> > > > > > Dim strConnection1 As String = "server=localhost;
database=Northwind;
> "
> > &
> > > _
> > > > > > "integrated security=true"
> > > > > > Dim objConnection As New SqlConnection(strConnection)
> > > > > > Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
> > > > > > "FROM Employees;"
> > > > > > Dim objCommand As New SqlCommand(strSQL, objConnection)
> > > > > > objConnection.Open()
> > > > > > Response.Write("ServerVersion: " & objConnection.ServerVersion & _
> > > > > > vbCRLF & "Datasource: " & objConnection.DataSource & _
> > > > > > vbCRLF & "Database: " & objConnection.Database)
> > > > > > dgNameList.DataSource = objCommand.ExecuteReader()
> > > > > > dgNameList.DataBind()
> > > > > > objConnection.Close()
> > > > > > End Sub
> > > > > > '==================
> > > > > > Can someone tell me what is wrong & also ALL the authentication
> settings
> > > > step by step I need in Windows 2000 server / SQL 2000 server ?
> > > > This is just the freaking local machine & server. I cannot believe
> this
> > is
> > > > so hard.
> > > > Last time someone in some newsgroup had me play with registry
> settings
> > to
> > > > make this work
> > > > in addition to some other Windows 2000 user changes
> > > > (Sorry I did not save it ...did not know this would be so bad)
> > > > > > I would prefer a complete code page that does both Integrated Auth
(as
> > > > above) and also
> > > > SQL auth (using Username / PW).
> > > > (I know the actual call is a one or two line code but the exact
format
> > > > without syntax or other errors is the key)
> > > > > > > > I don't have VS-7 so I cannot drag & drop the SQL connector control
as
> > > > someone suggested.
> > > > > > > > > > > > > > > >
"S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
news:O6EeMLHeDHA.3224@.tk2msftngp13.phx.gbl...
> Lori,

?

Yes ?
I appreciate the link but honestly, it is a typical Microsoft link.
They just thorough bits & pieces here & there.

What I need is this (to achieve the simple goal)

1. What I need to do at the Windows 2000 Server level ( User security
settings, Registry or whatever)
2. What I need to do at the IIS-5 level
3. The asp.net code page using vb.net (or even c# is fine).

I was hoping someone would already have the code page & tell me the
corresponding settings
for items 2 & 3 above on their machine to use the code.

I have done enough "fishing" on this & getting tired of it.

"S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
news:eCg4FNHeDHA.2320@.TK2MSFTNGP12.phx.gbl...
> Lori,
> Sorry about that link. I copied and pasted the wrong one from my list.
> Here's the right one:
>
http://msdn.microsoft.com/library/d.../secnetch12.asp
>
> Sincerely,
> --
> S. Justin Gengo, MCP
> Web Developer
> Free code library at:
> www.aboutfortunate.com
> "Out of chaos comes order."
> Nietzche
>
> "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> news:bjq0u6$kldqf$1@.ID-158805.news.uni-berlin.de...
> > What I am trying say is this
> > It would make more sense if the error message described that permission
> was
> > denied at one of the
> > possible 3 layers . Even the KB article does not make any references to
> the
> > IIS layer.
> > That said, I am not sure what user to add where in IIS
> > And another thing.
> > How would the SQL Auth. work ? Does it not go thru IIS also anyway,
> > regardless ?
> > "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> > news:bjq07b$ljgdk$1@.ID-158805.news.uni-berlin.de...
> > > And another thing.
> > > The Microsoft error message is so misleading.
> > > If there is a problem with IIS permissions why the hell does it say
> > > "SQL server does not exist ?" Very helpful if troubleshooting is it
not
> ,
> > by
> > > misleading you ?
> > > Also "access denied" by whom by SQL server ? By 2000 Server ? By IIS
?
> > > Can they be anymore vague ?
> > > > "S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
> > > news:eNMgDwGeDHA.1748@.TK2MSFTNGP10.phx.gbl...
> > > > Lori,
> > > > > > When you are connecting to SQL server in integrated security mode
IIS
> is
> > > > passing SQL server the account used to run the website. If you
haven't
> > > > changed the web site to use impersonation (you would do that in the
> > > > web.config file) then the site is passing SQL server the anonymous
> login
> > > > account which the website would normally run under. Depending on
your
> > > needs
> > > > their are multiple ways to configure this.
> > > > > > Here's a good article to get you started:
> > > > > > http://support.microsoft.com/defaul...B;EN-US;q176378
> > > > > > Sincerely,
> > > > > > --
> > > > S. Justin Gengo, MCP
> > > > Web Developer
> > > > > > Free code library at:
> > > > www.aboutfortunate.com
> > > > > > "Out of chaos comes order."
> > > > Nietzche
> > > > > > > > "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> > > > news:bjpt0d$li3vt$1@.ID-158805.news.uni-berlin.de...
> > > > > > > > > > > I am only trying to connect to a local host .
> > > > > I am on Windows 2000 Server with sql 2000 server.
> > > > > > > > > > > My error is the classic "SQL server does not exist or access
denied"
> > > > > I went to the MS site & they tell me what I know....."some"
> > > permissioning
> > > > > issue.
> > > > > > > > I had this code working 2 months ago on a different server but now
I
> > > > cannot
> > > > > get it going now on a different
> > > > > machine
> > > > > > > > I can setup ODBC connections every which way to this local server
> > using
> > > > > Integrated mode access
> > > > > using different connectivity methods such as by using "local" or
> > > > > <machinename> or 127.0.0.1 or <machine IP address>. I can also
> > connect
> > > > > using SQL authentication for user sa or some other new user I
> created.
> > > > > So I am not sure about this access denied BS.
> > > > > > > > I need to connect to Northwind & pubs dbs (the sample dbs that
come
> > with
> > > > sql
> > > > > 2000)
> > > > > Please post the complete page in (without code behind crap for
now).
> > > > > > > > I went to different sites & they have partial code & they cause
> > > different
> > > > > errors ( I am not a Vb.net guru)
> > > > > > > > The page I used is something similar to below.
> > > > > > > > I am just trying to connect & print the server name & SQL version
> etc
> > > > > > > > '================
> > > > > Sub Page_Load(Source As Object, E As EventArgs)
> > > > > > > > Dim strConnection1 As String = "server=localhost;
> database=Northwind;
> > "
> > > &
> > > > _
> > > > > > > > "integrated security=true"
> > > > > > > > Dim objConnection As New SqlConnection(strConnection)
> > > > > > > > Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
> > > > > > > > "FROM Employees;"
> > > > > > > > Dim objCommand As New SqlCommand(strSQL, objConnection)
> > > > > > > > objConnection.Open()
> > > > > > > > Response.Write("ServerVersion: " & objConnection.ServerVersion & _
> > > > > > > > vbCRLF & "Datasource: " & objConnection.DataSource & _
> > > > > > > > vbCRLF & "Database: " & objConnection.Database)
> > > > > > > > dgNameList.DataSource = objCommand.ExecuteReader()
> > > > > > > > dgNameList.DataBind()
> > > > > > > > objConnection.Close()
> > > > > > > > End Sub
> > > > > > > > '==================
> > > > > > > > Can someone tell me what is wrong & also ALL the authentication
> > settings
> > > > > step by step I need in Windows 2000 server / SQL 2000 server ?
> > > > > This is just the freaking local machine & server. I cannot believe
> > this
> > > is
> > > > > so hard.
> > > > > Last time someone in some newsgroup had me play with registry
> > settings
> > > to
> > > > > make this work
> > > > > in addition to some other Windows 2000 user changes
> > > > > (Sorry I did not save it ...did not know this would be so bad)
> > > > > > > > I would prefer a complete code page that does both Integrated Auth
> (as
> > > > > above) and also
> > > > > SQL auth (using Username / PW).
> > > > > (I know the actual call is a one or two line code but the exact
> format
> > > > > without syntax or other errors is the key)
> > > > > > > > > > > I don't have VS-7 so I cannot drag & drop the SQL connector
control
> as
> > > > > someone suggested.
> > > > > > > > > > > > > > > > > > > > > > > > > > >
Actually it should read like this

1. What I need to do at the Windows 2000 Server level ( User security
settings, Registry or whatever)
2. What I need to set at the SQL server 2000 level
3. What I need to do at the IIS-5 level
4. The asp.net code page using vb.net (or even c# is fine) & the project
file including web.config file if any

I ran into 100's code pages ( Item 4 ) that tells you how to connect but
none of them address other layers
(Items 1 thru 3 above)

I am hoping some of you can tell me your machine configs for items 1 thru 3
above.
I think item 4 is ok with what I have. (And I suspect item 2 is OK 2 for me)
It is the OS level or IIS settings that are always a pain.
It is amazing how painful it is for even everything local to same machine

"Lori" <__--LoriG--_@.yahoo.com> wrote in message
news:bjqbou$ltkeg$1@.ID-158805.news.uni-berlin.de...
> I appreciate the link but honestly, it is a typical Microsoft link.
> They just thorough bits & pieces here & there.
> What I need is this (to achieve the simple goal)
> 1. What I need to do at the Windows 2000 Server level ( User security
> settings, Registry or whatever)
> 2. What I need to do at the IIS-5 level
> 3. The asp.net code page using vb.net (or even c# is fine).
> I was hoping someone would already have the code page & tell me the
> corresponding settings
> for items 2 & 3 above on their machine to use the code.
> I have done enough "fishing" on this & getting tired of it.
>
>
> "S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
> news:eCg4FNHeDHA.2320@.TK2MSFTNGP12.phx.gbl...
> > Lori,
> > Sorry about that link. I copied and pasted the wrong one from my list.
> > Here's the right one:
http://msdn.microsoft.com/library/d.../secnetch12.asp
> > Sincerely,
> > --
> > S. Justin Gengo, MCP
> > Web Developer
> > Free code library at:
> > www.aboutfortunate.com
> > "Out of chaos comes order."
> > Nietzche
> > "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> > news:bjq0u6$kldqf$1@.ID-158805.news.uni-berlin.de...
> > > What I am trying say is this
> > > It would make more sense if the error message described that
permission
> > was
> > > denied at one of the
> > > possible 3 layers . Even the KB article does not make any references
to
> > the
> > > IIS layer.
> > > > That said, I am not sure what user to add where in IIS
> > > > And another thing.
> > > How would the SQL Auth. work ? Does it not go thru IIS also anyway,
> > > regardless ?
> > > > > "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> > > news:bjq07b$ljgdk$1@.ID-158805.news.uni-berlin.de...
> > > > And another thing.
> > > > The Microsoft error message is so misleading.
> > > > If there is a problem with IIS permissions why the hell does it say
> > > > "SQL server does not exist ?" Very helpful if troubleshooting is it
> not
> > ,
> > > by
> > > > misleading you ?
> > > > Also "access denied" by whom by SQL server ? By 2000 Server ? By
IIS
> ?
> > > > Can they be anymore vague ?
> > > > > > "S. Justin Gengo" <sjgengo@.aboutfortunate.com> wrote in message
> > > > news:eNMgDwGeDHA.1748@.TK2MSFTNGP10.phx.gbl...
> > > > > Lori,
> > > > > > > > When you are connecting to SQL server in integrated security mode
> IIS
> > is
> > > > > passing SQL server the account used to run the website. If you
> haven't
> > > > > changed the web site to use impersonation (you would do that in
the
> > > > > web.config file) then the site is passing SQL server the anonymous
> > login
> > > > > account which the website would normally run under. Depending on
> your
> > > > needs
> > > > > their are multiple ways to configure this.
> > > > > > > > Here's a good article to get you started:
> > > > > > > > http://support.microsoft.com/defaul...B;EN-US;q176378
> > > > > > > > Sincerely,
> > > > > > > > --
> > > > > S. Justin Gengo, MCP
> > > > > Web Developer
> > > > > > > > Free code library at:
> > > > > www.aboutfortunate.com
> > > > > > > > "Out of chaos comes order."
> > > > > Nietzche
> > > > > > > > > > > "Lori" <__--LoriG--_@.yahoo.com> wrote in message
> > > > > news:bjpt0d$li3vt$1@.ID-158805.news.uni-berlin.de...
> > > > > > > > > > > > > > I am only trying to connect to a local host .
> > > > > > I am on Windows 2000 Server with sql 2000 server.
> > > > > > > > > > > > > > My error is the classic "SQL server does not exist or access
> denied"
> > > > > > I went to the MS site & they tell me what I know....."some"
> > > > permissioning
> > > > > > issue.
> > > > > > > > > > I had this code working 2 months ago on a different server but
now
> I
> > > > > cannot
> > > > > > get it going now on a different
> > > > > > machine
> > > > > > > > > > I can setup ODBC connections every which way to this local
server
> > > using
> > > > > > Integrated mode access
> > > > > > using different connectivity methods such as by using "local" or
> > > > > > <machinename> or 127.0.0.1 or <machine IP address>. I can also
> > > connect
> > > > > > using SQL authentication for user sa or some other new user I
> > created.
> > > > > > So I am not sure about this access denied BS.
> > > > > > > > > > I need to connect to Northwind & pubs dbs (the sample dbs that
> come
> > > with
> > > > > sql
> > > > > > 2000)
> > > > > > Please post the complete page in (without code behind crap for
> now).
> > > > > > > > > > I went to different sites & they have partial code & they cause
> > > > different
> > > > > > errors ( I am not a Vb.net guru)
> > > > > > > > > > The page I used is something similar to below.
> > > > > > > > > > I am just trying to connect & print the server name & SQL
version
> > etc
> > > > > > > > > > '================
> > > > > > Sub Page_Load(Source As Object, E As EventArgs)
> > > > > > > > > > Dim strConnection1 As String = "server=localhost;
> > database=Northwind;
> > > "
> > > > &
> > > > > _
> > > > > > > > > > "integrated security=true"
> > > > > > > > > > Dim objConnection As New SqlConnection(strConnection)
> > > > > > > > > > Dim strSQL As String = "SELECT FirstName, LastName, Country " &
_
> > > > > > > > > > "FROM Employees;"
> > > > > > > > > > Dim objCommand As New SqlCommand(strSQL, objConnection)
> > > > > > > > > > objConnection.Open()
> > > > > > > > > > Response.Write("ServerVersion: " & objConnection.ServerVersion &
_
> > > > > > > > > > vbCRLF & "Datasource: " & objConnection.DataSource & _
> > > > > > > > > > vbCRLF & "Database: " & objConnection.Database)
> > > > > > > > > > dgNameList.DataSource = objCommand.ExecuteReader()
> > > > > > > > > > dgNameList.DataBind()
> > > > > > > > > > objConnection.Close()
> > > > > > > > > > End Sub
> > > > > > > > > > '==================
> > > > > > > > > > Can someone tell me what is wrong & also ALL the authentication
> > > settings
> > > > > > step by step I need in Windows 2000 server / SQL 2000 server ?
> > > > > > This is just the freaking local machine & server. I cannot
believe
> > > this
> > > > is
> > > > > > so hard.
> > > > > > Last time someone in some newsgroup had me play with registry
> > > settings
> > > > to
> > > > > > make this work
> > > > > > in addition to some other Windows 2000 user changes
> > > > > > (Sorry I did not save it ...did not know this would be so bad)
> > > > > > > > > > I would prefer a complete code page that does both Integrated
Auth
> > (as
> > > > > > above) and also
> > > > > > SQL auth (using Username / PW).
> > > > > > (I know the actual call is a one or two line code but the exact
> > format
> > > > > > without syntax or other errors is the key)
> > > > > > > > > > > > > > I don't have VS-7 so I cannot drag & drop the SQL connector
> control
> > as
> > > > > > someone suggested.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >