Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Wednesday, March 28, 2012

trivial ? build error

Hi all,
II am getting a build error for the folowing statement:
String sGetVarVal = Request.QueryString("myvar");
error:
System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
was expected
I though that the statement is correct!! have seen it a lot of times. Can
anyone help on this? Thanks
Carlos.Use [ ] - this squre brackets instead of this ( )
Regards
Thangam,
"Carlos" wrote:

> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
>
>
Carlos,
Have you just moved from vb to vc#?
String sGetVarVal = Request.QueryString["myvar"];
Eliyahu
"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
>
Try String sGetVarVal = Request.QueryString["myvar"];
You're using VB syntax in C# code.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================
"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
>
As others have pointed out, C# cleans up the ambiguity with respect to
functions() and arrays[]
If, as others have suggested, you are moving from VB.Net to C#, you might
want to check out:
http://www.harding.edu/USER/fmccown...comparison.html
Other than that my follow up to this thread has been little more than a
"what he said" ...but makes me feel nonetheless special :)
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
>

trivial ? build error

Hi all,

II am getting a build error for the folowing statement:

String sGetVarVal = Request.QueryString("myvar");

error:

System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
was expected

I though that the statement is correct!! have seen it a lot of times. Can
anyone help on this? Thanks

Carlos.Use [ ] - this squre brackets instead of this ( )

Regards
Thangam,

"Carlos" wrote:

> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
>
Carlos,

Have you just moved from vb to vc#?

String sGetVarVal = Request.QueryString["myvar"];

Eliyahu

"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
Try String sGetVarVal = Request.QueryString["myvar"];

You're using VB syntax in C# code.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================

"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>
As others have pointed out, C# cleans up the ambiguity with respect to
functions() and arrays[]

If, as others have suggested, you are moving from VB.Net to C#, you might
want to check out:
http://www.harding.edu/USER/fmccown...comparison.html

Other than that my follow up to this thread has been little more than a
"what he said" ...but makes me feel nonetheless special :)

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/

"Carlos" <ch_sanin@.yahoo.com> wrote in message
news:eLvJ0mrDFHA.1668@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> II am getting a build error for the folowing statement:
> String sGetVarVal = Request.QueryString("myvar");
> error:
> System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method'
> was expected
> I though that the statement is correct!! have seen it a lot of times. Can
> anyone help on this? Thanks
>
> Carlos.
>
>

Monday, March 26, 2012

Trouble getting started

I have created a new website on my server. I save myfirst page and try to open it and this is the error I get..... can anyone help me...

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The currentcustom error settings for this application prevent the details of theapplication error from being viewed remotely (for security reasons). Itcould, however, be viewed by browsers running on the local servermachine.

Details: To enable the details of this specific error message to beviewable on remote machines, please create a <customErrors> tagwithin a "web.config" configuration file located in the root directoryof the current web application. This <customErrors> tag shouldthen have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File --
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration
Notes: The current error page you are seeing can be replaced by acustom error page by modifying the "defaultRedirect" attribute of theapplication's <customErrors> configuration tag to point to acustom error page URL.

<!-- Web.Config Configuration File --
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

In your web.config file you have the following:

<customErrors mode="Off"/>

Change it to:

<customErrors mode="On"/>

So you will get the description of the real error.


Try it and that didn't work.. but I am not sure where to put that... so here is my xml file...

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="false" strict="false" explicit="true" />
<pages>
<namespaces>
<clear />
<add namespace="System" />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
<add namespace="System.Configuration" />
<add namespace="System.Text" />
<add namespace="System.Text.RegularExpressions" />
<add namespace="System.Web" />
<add namespace="System.Web.Caching" />
<add namespace="System.Web.SessionState" />
<add namespace="System.Web.Security" />
<add namespace="System.Web.Profile" />
<add namespace="System.Web.UI" />
<add namespace="System.Web.UI.WebControls" />
<add namespace="System.Web.UI.WebControls.WebParts" />
<add namespace="System.Web.UI.HtmlControls" />
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->

</system.web>
</configuration>


You need to do this:

<customErrorsmode="Off" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>


Nope.. didn't work... same error. I am opening my .xmlfile in Visual studio and then just saving it... I don't have to rebootthe webserver or anything right. Also I am not on thewwwroot. My file is in wwwroot/asp

Rich


Hmmmm. Try to replace this:

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>

with this:
<customErrors mode="Off"/>


if mode=

"On" specifies that custom errors are enabled. If no defaultRedirect is specified, users see a generic error.

"Off" specifies that custom errors are disabled. This allows display of detailed errors.

"RemoteOnly" specifies that custom errors are shown only to remote clients, and ASP.NET errors are shown to the local host. This is the default.


Still not working. God this is frustrating. Is there some settings that I have to be changing on my server orsomething??

Since I am new to ASP.. do I need the web.config file?

What is the error that I am actually getting or you can't tell because the error won't show on the page??

Rich


I think you are working directly on your web site virtual path; where you have a tool "Visual Web Developper Express Edition" that you can download for free and work on it on a temporary folder; then after testing your site, you can upload it to whatever IIS server you wish. Correct me if this is not the situation that you are in.

After all, please post the page html, and code behind that you are trying to run.


Hello,

Please do bare with me. I am brand now to ASP, I am switiching from cold fusion.

Soi am working on my computer and I created a new website on mywebserver. I working out of a folder called ASP under thewwwroot.


Not sure what you mean by "web site virtual path". I openmy visual studio, and instead of creating a webstie on my webserver Icreated a new website on mycomputer. I can't seem tofind the directory where it created the website. I found theplace where I copy the files to the remote web site. So i copiedthe website through visual studio over to my webserver. I try toview the page but it give me the same error. Here is my code forthe web page I am trying to run. It is a general template and Ijust put some letters inside the form.

<%@. Page Language="VB" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server"
</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
sdsdaf
</div>
</form>
</body>
</html


First in Visual Studio, there is a window called "Solution Explorer"; if you select the project (left click once on the root of the project), you will find in the properties window a property "Opened URL" which will show you what is the path of your project.

Second before uploading (copying) your files to the remote website, you can run your web application directly from Visual Studio by pressing F5 (to run with debugging enabled) or Ctrl+F5 (to run without debugging enable). So, try to run your application from Visual Studio and see what error you are getting.


As said above check for the virtual folder setting if problem still is not solved get the event log files and post the error message here.


Ok.. so I just did the F5 thing... and the page loaded fine.

So it started a local service host on my computer and ran the page with no errors.


SO now do I copy over to my webserver??

So now I can develop my whole site on my computer and then move it to my webserver??

Rich


Of course you can develop your website on your computer and then move it to your web server.

But you have already mentioned that you have created a website on your web server; are you sure you have configured it correctly? have you installed the asp.net extensions for this website?


I tried creating a new website right on my webserver. And I hit the F5 button, but ran fine with no errors. It lookedlike it ran off my local host on my terminal computer and not thewebserver. SO i went to the page through IE and ran it off thewebserver and then it kicked me the same error. So obivisouly anddon't have the .net set up right on my server. Anychance you know what is going wrong on my webserver...

Rich

Trouble getting the ASP.NET error page to appear remotely

I have been developing a web application on a local host and then
using 'Copy Project' to copy all the files up to the ISP location.
When I run the application locally then all is OK. When I run the
application from the ISP site I get an runtime error.
Because the default page does not givem me any indication as to what
the actual problem is, then I change the web.config file using the
recommended custom error tags as follows:
<customErrors mode= "Off" />
This did not result in me getting the detailed page that would have
been displayed at the server on the ISP. So I tried to create a custom
page by creating a HTML file 'mycustompage.htm' and the modifying the
tag to give:
<customErrors mode= "RemoteOnly" defaultRedirect="mycustompage.htm" />
But the result is still the default page with no indication of error.
It is as if the application is not reading the web.config file.
The tag above had been entered inside the existing <system.web> tag.
Any help would be appreciated.
John L"John Lundrigan" <jonel@.glenavon1.demon.co.uk> wrote in message
news:gkqac05vk2ctuc2bchs18iru81muov4q21@.
4ax.com...
> I have been developing a web application on a local host and then
> using 'Copy Project' to copy all the files up to the ISP location.
> When I run the application locally then all is OK. When I run the
> application from the ISP site I get an runtime error.
...

> But the result is still the default page with no indication of error.
> It is as if the application is not reading the web.config file.
Maybe it isn't reading it. Try introducing a syntax error into the
web.config file and see if the syntax error is caught.
Are you sure your ISP has your app set up as an application in IIS?
--
John Saunders
johnwsaundersiii at hotmail

Trouble getting the ASP.NET error page to appear remotely

I have been developing a web application on a local host and then
using 'Copy Project' to copy all the files up to the ISP location.
When I run the application locally then all is OK. When I run the
application from the ISP site I get an runtime error.

Because the default page does not givem me any indication as to what
the actual problem is, then I change the web.config file using the
recommended custom error tags as follows:

<customErrors mode= "Off" /
This did not result in me getting the detailed page that would have
been displayed at the server on the ISP. So I tried to create a custom
page by creating a HTML file 'mycustompage.htm' and the modifying the
tag to give:

<customErrors mode= "RemoteOnly" defaultRedirect="mycustompage.htm" /
But the result is still the default page with no indication of error.
It is as if the application is not reading the web.config file.

The tag above had been entered inside the existing <system.web> tag.

Any help would be appreciated.

John L"John Lundrigan" <jonel@.glenavon1.demon.co.uk> wrote in message
news:gkqac05vk2ctuc2bchs18iru81muov4q21@.4ax.com...
> I have been developing a web application on a local host and then
> using 'Copy Project' to copy all the files up to the ISP location.
> When I run the application locally then all is OK. When I run the
> application from the ISP site I get an runtime error.
...

> But the result is still the default page with no indication of error.
> It is as if the application is not reading the web.config file.

Maybe it isn't reading it. Try introducing a syntax error into the
web.config file and see if the syntax error is caught.

Are you sure your ISP has your app set up as an application in IIS?
--
John Saunders
johnwsaundersiii at hotmail

Saturday, March 24, 2012

Trouble saving html in a string variable

I'm trying to allow a user to enter html text into a textBox (FreeTextBox) but am getting an error upon submitting:

A potentially dangerous Request.Form value was detected from the client (noteTextBox="<H2><FONT size=6>asd...").
Description:Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details:System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (noteTextBox="<H2><FONT size=6>asd...").

Anybody know how to deal with this while still allowing me to save the html?

<%@. Page...... ValidateRequest="false".....%>


I think the reason for this error was that someone could enter a <script> tag in your textbox with javascript code, and then if you grab that value from the form and display directly it on another page, the code in the <script> tag would be executed on your user's computer... this could be potentially bad. i usually turn the error off though, like the previous poster. If you HtmlEncode() anything that you display that ultimately came from the user, it should be ok to turn it off.


How do I HtmlEncode() this text?


dim myText as String = Server.HtmlEncode(yourTextbox.Text)

Trouble setting up .NET to email

I read the FAQ on setting up the Virtual Email Server, but I am still having trouble getting .NET to send an email:

The error I'm getting is "Could not access 'CDO.Message' object."

Now, I'm not sure, but could it have something to do with the fact that my computer is hooked up to a base station (router) that may have the port blocked?

If so, do you know which port/s I should try forwarding?

I could have just F'ed something else up along the way, anyways, if anyone has any ideas, I'd love to hear them.

Thanks in advance,

GrierThis is probably a problem with the security settings in the IIS SMTP service. Have you checked the SMPTSVC log or the Event Viewer for any messages?
I believe 25 is the default port for SMTP. Are you specifying "localhost" as your SmtpMail.SmtpServer?
You are correct. 25 is the default SMTP port.
Could you post some of your code so we can decipher what is going on?
Thanks for the response!!! I have not checked the logs, (not sure if I know how...)


void OnSend (Object sender, EventArgs e)
{
MailMessage message = new MailMessage();

message.From = "gallen@.slantmedia.net";
message.To = "gallen@.slantmedia.net";
message.Subject = "Validate This Message";
message.Body = Body.Text;
SmtpMail.SmtpServer = "localhost";

try
{
SmtpMail.Send (message);
Label1.Text = "Message Sent!";
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}

there is the code I've been using, thanks for taking a look!!!!

G
There are two places to check for logs. The first is the Windows Event Viewer. This can be found under the Administrative Tools. Look in the System log for any events with "SMTPSVC" as the source.

Second you can check the logfile that is generated by the SMTP service. This can be found in %windir%\system32\logfiles\smtpsvc1 by default. This may not provide as much information if you are not very familiar with SMTP.

Your code looks pretty standard so I don't think that the problem rests there. The next thing to look at is the setup for your SMTP service. Normally SMTP servers only allow messages which are addressed to a domain that is hosted by that server. Getting the SMTP server to accept a message from you (or from ASP.NET) and forward on to another mail server is called relaying. You have to configure your server to allow this.

Go to Administrative Tools > Internet Information Services > Default SMTP Virtual Server > (right click) > Properties > Access Tab > Relay. This will open the Relay Restrictions window. Select "only the list below" and then add 127.0.0.1 as an allowed computer. After you have completed this configuration, try running through your code again.

trouble with DataReader

Hi group,

I'm trying to use a DataReader but I get an error.

This is my code:

private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection oCon = new SqlConnection("server=server;uid=id;" +
"pwd=pwd;database=database");
SqlCommand oCmd = new SqlCommand("SELECT nieuwsid, datum, titel FROM news
WHERE datum <= { fn CURDATE() })ORDER BY datum DESC",oCon);
oCon.Open();
oCmd.Connection=oCon;
SqlDataReader dr = oCmd.ExecuteReader();
oCmd.Dispose ();
oCon.Close();
oCon.Dispose();
}

I have an error at runtime on the line SqlDataReader dr =
oCmd.ExecuteReader();
The error is: Incorrect syntax near ')'.

With I simply delete the line with the error then I don't get an error, so I
think the error is in the line SqlDataReader dr = oCmd.ExecuteReader();

Can someone say what I do wrong ?

grz

Bernie V

--
http://www.djberniev.beI think you query syntax is off. Try running it in query analyzer and fix
it.

"Bernie V" <bernd.vantyghem@.pandoradotbe> wrote in message
news:uXVuK8K8DHA.2924@.tk2msftngp13.phx.gbl...
> Hi group,
> I'm trying to use a DataReader but I get an error.
> This is my code:
> private void Page_Load(object sender, System.EventArgs e)
> {
> SqlConnection oCon = new SqlConnection("server=server;uid=id;" +
> "pwd=pwd;database=database");
> SqlCommand oCmd = new SqlCommand("SELECT nieuwsid, datum, titel FROM news
> WHERE datum <= { fn CURDATE() })ORDER BY datum DESC",oCon);
> oCon.Open();
> oCmd.Connection=oCon;
> SqlDataReader dr = oCmd.ExecuteReader();
> oCmd.Dispose ();
> oCon.Close();
> oCon.Dispose();
> }
> I have an error at runtime on the line SqlDataReader dr =
> oCmd.ExecuteReader();
> The error is: Incorrect syntax near ')'.
> With I simply delete the line with the error then I don't get an error, so
I
> think the error is in the line SqlDataReader dr = oCmd.ExecuteReader();
> Can someone say what I do wrong ?
> grz
> Bernie V
>
> --
> http://www.djberniev.be
"Marina" <someone@.nospam.com> schreef in bericht
news:umi3Y$K8DHA.2064@.TK2MSFTNGP11.phx.gbl...
> I think you query syntax is off. Try running it in query analyzer and fix
> it.

Hi Marina,

This was also my first opinion. But I changed the query to a simple select
query and I had the same problem.
The query like I use works in the query analyser.

grz

Bernie V

--
http://www.djberniev.be
The error message indicates a syntax problem with the query. I would suggest
either putting a breakpoint in, or recording the generated query somewhere
so that you can copy the generated query string and run it in Query Analyzer
to find out the problem with it.

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

"Bernie V" <bernd.vantyghem@.pandoradotbe> wrote in message
news:#YfjfNL8DHA.1504@.TK2MSFTNGP12.phx.gbl...
> "Marina" <someone@.nospam.com> schreef in bericht
> news:umi3Y$K8DHA.2064@.TK2MSFTNGP11.phx.gbl...
> > I think you query syntax is off. Try running it in query analyzer and
fix
> > it.
> Hi Marina,
> This was also my first opinion. But I changed the query to a simple select
> query and I had the same problem.
> The query like I use works in the query analyser.
> grz
> Bernie V
> --
> http://www.djberniev.be
"Marina" <someone@.nospam.com> schreef in bericht
news:umi3Y$K8DHA.2064@.TK2MSFTNGP11.phx.gbl...
> I think you query syntax is off. Try running it in query analyzer and fix
> it.

Marina,

I double cheked and you 're right !
There where to many ')' .

Thx !

grz

Bernie V
Looks like you dont have a corresponding '('

Bernie V wrote:

> Hi group,
> I'm trying to use a DataReader but I get an error.
> This is my code:
> private void Page_Load(object sender, System.EventArgs e)
> {
> SqlConnection oCon = new SqlConnection("server=server;uid=id;" +
> "pwd=pwd;database=database");
> SqlCommand oCmd = new SqlCommand("SELECT nieuwsid, datum, titel FROM news
> WHERE datum <= { fn CURDATE() })ORDER BY datum DESC",oCon);
> oCon.Open();
> oCmd.Connection=oCon;
> SqlDataReader dr = oCmd.ExecuteReader();
> oCmd.Dispose ();
> oCon.Close();
> oCon.Dispose();
> }
> I have an error at runtime on the line SqlDataReader dr =
> oCmd.ExecuteReader();
> The error is: Incorrect syntax near ')'.
> With I simply delete the line with the error then I don't get an error, so I
> think the error is in the line SqlDataReader dr = oCmd.ExecuteReader();
> Can someone say what I do wrong ?
> grz
> Bernie V

--
Regards,
Dilip Krishnan
dilipkrish at msn. com

Thursday, March 22, 2012

Trouble with new server

I have switched to a new server and all of a sudden all my sites have stopped working.

Trying to simply the sites to narrow down the error I have found that a blank page with a code behind file (also empty) will not run. The page is helpfully only giving the runtime error message saying to put customerrors = "Off" in web.config but if I put any form of web.config file up I get the same error even with a page that runs fine without a default config file.


If I put my code in the file rather than code behind then the code operates (assuming there is no web.config file etc)


Any ideas anyone?

have you verified that the new webserver is set to asp.net 2.0? also, you should turn customerrors to off so you can see the actual error. that would be helpful (or if you can remote in, you will see the error if you run localhost.)


I tried turning custom errors off and it made no difference.

I found out that contrary to them saying it is 2.0 the machine actually only has 1.1 installed on it.

Tuesday, March 13, 2012

Trouble with sqlCommand

I can't undertand why that's don't works, can somebody help me?
thanks a lot
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: CS0120: An object reference is required for the
nonstatic field, method, or property
'System.Data.SqlClient.SqlCommand.CommandType'
Source Error:
Line 1: bool ValidateUser(string strLogin, string strPassword, int nLevel,
SqlConnection sqlConn){
Line 2: SqlCommand sqlComm = new SqlCommand("spValidateUser", sqlConn);
Line 3: SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
Line 4:
Line 5: SqlParameter sqlParamLogin = new SqlParameter("@dotnet.itags.org.Usuario",
System.Data.SqlDbType.VarChar);
Source File: C:\Meus DOC\Sites\Loja Virtual .NET\www\library\functions.cs
Line: 3Change this line:
SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
to sqlComm.CommandType = System.Data.CommandType.StoredProcedure;
That's it.
"Eduardo Rosa" <eduardo@.clas.com.br> wrote in message
news:%23XKeuVL$EHA.1264@.TK2MSFTNGP12.phx.gbl...
> I can't undertand why that's don't works, can somebody help me?
> thanks a lot
>
> Description: An error occurred during the compilation of a resource
required
> to service this request. Please review the following specific error
details
> and modify your source code appropriately.
> Compiler Error Message: CS0120: An object reference is required for the
> nonstatic field, method, or property
> 'System.Data.SqlClient.SqlCommand.CommandType'
> Source Error:
>
> Line 1: bool ValidateUser(string strLogin, string strPassword, int
nLevel,
> SqlConnection sqlConn){
> Line 2: SqlCommand sqlComm = new SqlCommand("spValidateUser", sqlConn);
> Line 3: SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
> Line 4:
> Line 5: SqlParameter sqlParamLogin = new SqlParameter("@.Usuario",
> System.Data.SqlDbType.VarChar);
> Source File: C:\Meus DOC\Sites\Loja Virtual .NET\www\library\functions.cs
> Line: 3
>
>
that's so basic, I feel shame.
thanks a lot
"Michael C" <me@.mine.com> escreveu na mensagem
news:es4SWlL$EHA.1524@.TK2MSFTNGP09.phx.gbl...
> Change this line:
> SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
> to sqlComm.CommandType = System.Data.CommandType.StoredProcedure;
> That's it.
>
> "Eduardo Rosa" <eduardo@.clas.com.br> wrote in message
> news:%23XKeuVL$EHA.1264@.TK2MSFTNGP12.phx.gbl...
> required
> details
> nLevel,
>
Trust me, we've all been there, done that :) Sometimes you just need a
fresh pair of eyes to scan it for you :)
Thanks
"Eduardo Rosa" <eduardo@.clas.com.br> wrote in message
news:%23RTy5SM$EHA.3336@.TK2MSFTNGP11.phx.gbl...
> that's so basic, I feel shame.
> thanks a lot
>
>
> "Michael C" <me@.mine.com> escreveu na mensagem
> news:es4SWlL$EHA.1524@.TK2MSFTNGP09.phx.gbl...
sqlConn);
.NET\www\library\functions.cs
>

Trouble with sqlCommand

I can't undertand why that's don't works, can somebody help me?

thanks a lot

Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: CS0120: An object reference is required for the
nonstatic field, method, or property
'System.Data.SqlClient.SqlCommand.CommandType'

Source Error:

Line 1: bool ValidateUser(string strLogin, string strPassword, int nLevel,
SqlConnection sqlConn){
Line 2: SqlCommand sqlComm = new SqlCommand("spValidateUser", sqlConn);
Line 3: SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
Line 4:
Line 5: SqlParameter sqlParamLogin = new SqlParameter("@dotnet.itags.org.Usuario",
System.Data.SqlDbType.VarChar);

Source File: C:\Meus DOC\Sites\Loja Virtual .NET\www\library\functions.cs
Line: 3Change this line:

SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

to sqlComm.CommandType = System.Data.CommandType.StoredProcedure;

That's it.

"Eduardo Rosa" <eduardo@.clas.com.br> wrote in message
news:%23XKeuVL$EHA.1264@.TK2MSFTNGP12.phx.gbl...
> I can't undertand why that's don't works, can somebody help me?
> thanks a lot
>
> Description: An error occurred during the compilation of a resource
required
> to service this request. Please review the following specific error
details
> and modify your source code appropriately.
> Compiler Error Message: CS0120: An object reference is required for the
> nonstatic field, method, or property
> 'System.Data.SqlClient.SqlCommand.CommandType'
> Source Error:
>
> Line 1: bool ValidateUser(string strLogin, string strPassword, int
nLevel,
> SqlConnection sqlConn){
> Line 2: SqlCommand sqlComm = new SqlCommand("spValidateUser", sqlConn);
> Line 3: SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
> Line 4:
> Line 5: SqlParameter sqlParamLogin = new SqlParameter("@.Usuario",
> System.Data.SqlDbType.VarChar);
> Source File: C:\Meus DOC\Sites\Loja Virtual .NET\www\library\functions.cs
> Line: 3
>
that's so basic, I feel shame.
thanks a lot

"Michael C" <me@.mine.com> escreveu na mensagem
news:es4SWlL$EHA.1524@.TK2MSFTNGP09.phx.gbl...
> Change this line:
> SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
> to sqlComm.CommandType = System.Data.CommandType.StoredProcedure;
> That's it.
>
> "Eduardo Rosa" <eduardo@.clas.com.br> wrote in message
> news:%23XKeuVL$EHA.1264@.TK2MSFTNGP12.phx.gbl...
>> I can't undertand why that's don't works, can somebody help me?
>>
>> thanks a lot
>>
>>
>> Description: An error occurred during the compilation of a resource
> required
>> to service this request. Please review the following specific error
> details
>> and modify your source code appropriately.
>>
>> Compiler Error Message: CS0120: An object reference is required for the
>> nonstatic field, method, or property
>> 'System.Data.SqlClient.SqlCommand.CommandType'
>>
>> Source Error:
>>
>>
>> Line 1: bool ValidateUser(string strLogin, string strPassword, int
> nLevel,
>> SqlConnection sqlConn){
>> Line 2: SqlCommand sqlComm = new SqlCommand("spValidateUser", sqlConn);
>> Line 3: SqlCommand.CommandType =
>> System.Data.CommandType.StoredProcedure;
>> Line 4:
>> Line 5: SqlParameter sqlParamLogin = new SqlParameter("@.Usuario",
>> System.Data.SqlDbType.VarChar);
>>
>> Source File: C:\Meus DOC\Sites\Loja Virtual .NET\www\library\functions.cs
>> Line: 3
>>
>>
>>
>>
Trust me, we've all been there, done that :) Sometimes you just need a
fresh pair of eyes to scan it for you :)

Thanks

"Eduardo Rosa" <eduardo@.clas.com.br> wrote in message
news:%23RTy5SM$EHA.3336@.TK2MSFTNGP11.phx.gbl...
> that's so basic, I feel shame.
> thanks a lot
>
>
> "Michael C" <me@.mine.com> escreveu na mensagem
> news:es4SWlL$EHA.1524@.TK2MSFTNGP09.phx.gbl...
> > Change this line:
> > SqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
> > to sqlComm.CommandType = System.Data.CommandType.StoredProcedure;
> > That's it.
> > "Eduardo Rosa" <eduardo@.clas.com.br> wrote in message
> > news:%23XKeuVL$EHA.1264@.TK2MSFTNGP12.phx.gbl...
> >> I can't undertand why that's don't works, can somebody help me?
> >>
> >> thanks a lot
> >>
> >>
> >> Description: An error occurred during the compilation of a resource
> > required
> >> to service this request. Please review the following specific error
> > details
> >> and modify your source code appropriately.
> >>
> >> Compiler Error Message: CS0120: An object reference is required for the
> >> nonstatic field, method, or property
> >> 'System.Data.SqlClient.SqlCommand.CommandType'
> >>
> >> Source Error:
> >>
> >>
> >> Line 1: bool ValidateUser(string strLogin, string strPassword, int
> > nLevel,
> >> SqlConnection sqlConn){
> >> Line 2: SqlCommand sqlComm = new SqlCommand("spValidateUser",
sqlConn);
> >> Line 3: SqlCommand.CommandType =
> >> System.Data.CommandType.StoredProcedure;
> >> Line 4:
> >> Line 5: SqlParameter sqlParamLogin = new SqlParameter("@.Usuario",
> >> System.Data.SqlDbType.VarChar);
> >>
> >> Source File: C:\Meus DOC\Sites\Loja Virtual
..NET\www\library\functions.cs
> >> Line: 3
> >>
> >>
> >>
> >>