Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Saturday, March 31, 2012

the beginner-examples

http://samples.gotdotnet.com/quickstart/aspplus/

I went to the url above, and I am following there pages
to get knowledge.

But several examples, "run sample", is not working.
How come they couldnt manage to keep them
working ?

I feel it is a little harder to learn, since it really isnt
a fully working tutorial-site.

/ martin kHi Takemeaway,

I noticed the same stuff but I learnt they've got heavy traffic on the site that hampers their performance!
Which ones didn't work? I just tried a few on that site and they seemed to work. More importantly, is there a specific question you had about one of those tutorials?
Try here, these all work:

http://asp.net/Tutorials/quickstart.aspx

The bass class System.Web.UI.Page cannot be designed.

Help!!

I am now getting the following error concerning the Microsoft Development Environment in .NET:

=========================================================
The file failed to load in the Web Form designer. Please correct the following error, then load it again: The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file:

contactbroker -- The base class 'System.Web.UI.Page' cannot be designed.
=========================================================

What do I need to do. This happens with all of my .aspx pages not just the one listed in the error message. Is there another reference I need to load into my solution. I currently have the following reference listed:

Microsoft.Web.UI.WebControls
MSHTML
stdole
System
System.Data
System.Drawing
System.Security
System.Web
System.Web.ReqularExpressions
System.Web.Services
System.Windows.Forms
System.XML
tabDlg

I hope this is enought info to help you figure out what my problem is, other than be too ignorant to figure it out for myself...

Thanks

ArtAre you trying to build a page class in a usercontrol?
I guess I don't even know enough to understand your question. Can you help me out a little further? Thanks
Yeah, that was a bad response on my part. Basically, are you trying to do things in an ascx file that should are meant for aspx. If you are working in an aspx page, you can use the system.web.ui.page, but if you are in a usercontrol (ascx) you must make use of system.web.ui.usercontrol or whatever. Also remember (Just a heads up, not releated to your current problem), a page can only have one form tag and your ascx files cannot have a form tag because this is used in the page which those usercontrols will sit inside of.
Here is my situation. I installed .NET Framework 1.1 yesterday. I already had .NET Framework 1.0 installed. I installed 1.1 because I wanted to take advantage of the HasRows Property when check to see if a dataReader had returned any rows. After I installed 1.1 I got an error on the HasRows property. I then removed the version 1.0 System.Data, System.Drawing, System.Security, System.Web, System.Web.RegularExpressions, System.WebServices, and System.XML references and replaced them all with 1.1 version. Well the HasRows problem went away but now, every time I try to open one of my .aspx pages I get the error that is the subject of this post. Additoinally I can no longer get into the design mode for any of these forms.

I haven't changed any of the code, or added any additional references to the project.
What version of Visual Studio are you using?
Microsoft Development Environment 2002 Version 7.0.94466

The beginning.

Ok,

I have a file 'WeatherPage.aspx' with the following code, basic stuff:

<%@dotnet.itags.org. Page language="VB" %>
<script runat="server"
Shared rand As Random = New Random()
Function GetForecast(zip As String) As String
Dim ret As String = String.Empty
Select rand.Next(5)
Case 0
ret = "Sunny and warm"
Case 1
ret = "Partly cloudy and chilly"
Case 2
ret = "Cold with a chance of snow"
Case 3
ret = "Rain"
Case 4
ret = "Foggy and damp"
End Select
Return ret
End Function

</script>
<html>
<body>
<h1>My weather forecast page</h1>
<p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
<p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
<p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
<p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
<p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
</body>
</html
my operating system is Windows XP profesional. I use Internet Information
Services 5.1 (IIS).

When I run this page in a webbrowser, the function 'GetForecast' doesn't
display anything ( no error's). All I see is the HTML text. What can I be
doing wrong? I got this code from a tutorial.
Is the code incorrect? Can IIS have incorrect settings?

Thanks.The browser does give an error: Line 4, ";" is expected.
Isn't ";" used for "C#".
Page language is set to "VB".

"Qwert" <nosp@dotnet.itags.org.nosp.com> schreef in bericht
news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
> Ok,
> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
> <%@dotnet.itags.org. Page language="VB" %>
> <script runat="server">
> Shared rand As Random = New Random()
> Function GetForecast(zip As String) As String
> Dim ret As String = String.Empty
> Select rand.Next(5)
> Case 0
> ret = "Sunny and warm"
> Case 1
> ret = "Partly cloudy and chilly"
> Case 2
> ret = "Cold with a chance of snow"
> Case 3
> ret = "Rain"
> Case 4
> ret = "Foggy and damp"
> End Select
> Return ret
> End Function
> </script>
> <html>
> <body>
> <h1>My weather forecast page</h1>
> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
> </body>
> </html>
>
> my operating system is Windows XP profesional. I use Internet Information
> Services 5.1 (IIS).
> When I run this page in a webbrowser, the function 'GetForecast' doesn't
> display anything ( no error's). All I see is the HTML text. What can I be
> doing wrong? I got this code from a tutorial.
> Is the code incorrect? Can IIS have incorrect settings?
> Thanks.
You need to enclose your frunctions within

Sub

End Sub

statements.

If you want the code to execut automatically
when the page loads, use Sub Page_Load :

<script runat="server">
Sub Page_Load(Src as Object, e As System.EventArgs)

...rest of your code

End Sub
<//script
best,

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

"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
> Ok,
> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
> <%@dotnet.itags.org. Page language="VB" %>
> <script runat="server"
> Shared rand As Random = New Random()
> Function GetForecast(zip As String) As String
> Dim ret As String = String.Empty
> Select rand.Next(5)
> Case 0
> ret = "Sunny and warm"
> Case 1
> ret = "Partly cloudy and chilly"
> Case 2
> ret = "Cold with a chance of snow"
> Case 3
> ret = "Rain"
> Case 4
> ret = "Foggy and damp"
> End Select
> Return ret
> End Function
> </script>
> <html>
> <body>
> <h1>My weather forecast page</h1>
> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
> </body>
> </html>
>
> my operating system is Windows XP profesional. I use Internet Information
> Services 5.1 (IIS).
> When I run this page in a webbrowser, the function 'GetForecast' doesn't
> display anything ( no error's). All I see is the HTML text. What can I be
> doing wrong? I got this code from a tutorial.
> Is the code incorrect? Can IIS have incorrect settings?
> Thanks.
You mean something like this, it does not work either:

<html
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Message.Text = "You last accessed this page at: " & DateTime.Now
End Sub
</script
<body>
<h3><font face="Verdana">Manipulating Server Controls</font></h3>
This sample demonstrates how to manipulate the <asp:label>
server control within
the Page_Load event to output the current time.
<p>
<hr>
<asp:label id="Message" font-size="24" font-bold="true"
runat=server/>
</body>
</html
I see the HTML in the browser, but not the Message.Text in the label
control.

"Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
> You need to enclose your frunctions within
> Sub
> End Sub
> statements.
> If you want the code to execut automatically
> when the page loads, use Sub Page_Load :
> <script runat="server">
> Sub Page_Load(Src as Object, e As System.EventArgs)
> ...rest of your code
> End Sub
> <//script>
> best,
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>> Ok,
>>
>> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
>>
>> <%@dotnet.itags.org. Page language="VB" %>
>> <script runat="server">
>> Shared rand As Random = New Random()
>> Function GetForecast(zip As String) As String
>> Dim ret As String = String.Empty
>> Select rand.Next(5)
>> Case 0
>> ret = "Sunny and warm"
>> Case 1
>> ret = "Partly cloudy and chilly"
>> Case 2
>> ret = "Cold with a chance of snow"
>> Case 3
>> ret = "Rain"
>> Case 4
>> ret = "Foggy and damp"
>> End Select
>> Return ret
>> End Function
>>
>> </script>
>> <html>
>> <body>
>> <h1>My weather forecast page</h1>
>> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
>> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
>> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
>> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
>> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
>> </body>
>> </html>
>>
>>
>> my operating system is Windows XP profesional. I use Internet Information
>> Services 5.1 (IIS).
>>
>> When I run this page in a webbrowser, the function 'GetForecast' doesn't
>> display anything ( no error's). All I see is the HTML text. What can I be
>> doing wrong? I got this code from a tutorial.
>> Is the code incorrect? Can IIS have incorrect settings?
>>
>> Thanks.
I just pasted your code into
http://asp.net.do/test/vbtest2.aspx

It works fine.

Are you using http://localhost/virtualdirectory/yourfile.aspx ?
Or http://localhost/yourfile.aspx ?
Or http://YourComputerName/virtualdirectory/yourfile.aspx ?
Or http://yourserver.com/directory/yourfile.aspx ?

If you are, and it still doesn't work, try re-registering ASP.NET
from the .NET framework's main directory :

aspnet_regiis -i

( You did install the .NET Framework, right ? )

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

"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
> You mean something like this, it does not work either:
> <html>
> <script language="VB" runat="server">
> Sub Page_Load(Sender As Object, E As EventArgs)
> Message.Text = "You last accessed this page at: " &
> DateTime.Now
> End Sub
> </script>
> <body>
> <h3><font face="Verdana">Manipulating Server Controls</font></h3>
> This sample demonstrates how to manipulate the <asp:label>
> server control within
> the Page_Load event to output the current time.
> <p>
> <hr>
> <asp:label id="Message" font-size="24" font-bold="true"
> runat=server/>
> </body>
> </html>
>
> I see the HTML in the browser, but not the Message.Text in the label
> control.
>
> "Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
> news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
>> You need to enclose your frunctions within
>>
>> Sub
>>
>> End Sub
>>
>> statements.
>>
>> If you want the code to execut automatically
>> when the page loads, use Sub Page_Load :
>>
>> <script runat="server">
>> Sub Page_Load(Src as Object, e As System.EventArgs)
>>
>> ...rest of your code
>>
>> End Sub
>> <//script>
>>
>> best,
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> http://asp.net.do/foros/
>> Foros de ASP.NET en Espaol
>> Ven, y hablemos de ASP.NET...
>> ======================
>>
>> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
>> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>>> Ok,
>>>
>>> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
>>>
>>> <%@dotnet.itags.org. Page language="VB" %>
>>> <script runat="server">
>>
>>> Shared rand As Random = New Random()
>>> Function GetForecast(zip As String) As String
>>> Dim ret As String = String.Empty
>>> Select rand.Next(5)
>>> Case 0
>>> ret = "Sunny and warm"
>>> Case 1
>>> ret = "Partly cloudy and chilly"
>>> Case 2
>>> ret = "Cold with a chance of snow"
>>> Case 3
>>> ret = "Rain"
>>> Case 4
>>> ret = "Foggy and damp"
>>> End Select
>>> Return ret
>>> End Function
>>>
>>> </script>
>>> <html>
>>> <body>
>>> <h1>My weather forecast page</h1>
>>> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
>>> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
>>> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
>>> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
>>> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
>>> </body>
>>> </html>
>>>
>>>
>>> my operating system is Windows XP profesional. I use Internet
>>> Information Services 5.1 (IIS).
>>>
>>> When I run this page in a webbrowser, the function 'GetForecast' doesn't
>>> display anything ( no error's). All I see is the HTML text. What can I
>>> be doing wrong? I got this code from a tutorial.
>>> Is the code incorrect? Can IIS have incorrect settings?
>>>
>>> Thanks.
>>
>>
> If you are, and it still doesn't work, try re-registering ASP.NET
> from the .NET framework's main directory :
> aspnet_regiis -i

It worked....but weird. Someone already installed .NET Framework. Doesn't
make sense ASP.NET needs a seperate installement...I wasn't there when it
was installed on my comp, maybe you can select an option during installation
that you don't want to install ASP.NET.

3 cheers for spain!

Thanks.

> ( You did install the .NET Framework, right ? )
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
> news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
>> You mean something like this, it does not work either:
>>
>> <html>
>>
>> <script language="VB" runat="server">
>> Sub Page_Load(Sender As Object, E As EventArgs)
>> Message.Text = "You last accessed this page at: " &
>> DateTime.Now
>> End Sub
>> </script>
>>
>> <body>
>> <h3><font face="Verdana">Manipulating Server Controls</font></h3>
>> This sample demonstrates how to manipulate the <asp:label>
>> server control within
>> the Page_Load event to output the current time.
>> <p>
>> <hr>
>> <asp:label id="Message" font-size="24" font-bold="true"
>> runat=server/>
>> </body>
>> </html>
>>
>>
>> I see the HTML in the browser, but not the Message.Text in the label
>> control.
>>
>>
>> "Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
>> news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
>>> You need to enclose your frunctions within
>>>
>>> Sub
>>>
>>> End Sub
>>>
>>> statements.
>>>
>>> If you want the code to execut automatically
>>> when the page loads, use Sub Page_Load :
>>>
>>> <script runat="server">
>>> Sub Page_Load(Src as Object, e As System.EventArgs)
>>>
>>> ...rest of your code
>>>
>>> End Sub
>>> <//script>
>>>
>>> best,
>>>
>>>
>>> Juan T. Llibre
>>> ASP.NET MVP
>>> http://asp.net.do/foros/
>>> Foros de ASP.NET en Espaol
>>> Ven, y hablemos de ASP.NET...
>>> ======================
>>>
>>> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
>>> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>>>> Ok,
>>>>
>>>> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
>>>>
>>>> <%@dotnet.itags.org. Page language="VB" %>
>>>> <script runat="server">
>>>
>>>> Shared rand As Random = New Random()
>>>> Function GetForecast(zip As String) As String
>>>> Dim ret As String = String.Empty
>>>> Select rand.Next(5)
>>>> Case 0
>>>> ret = "Sunny and warm"
>>>> Case 1
>>>> ret = "Partly cloudy and chilly"
>>>> Case 2
>>>> ret = "Cold with a chance of snow"
>>>> Case 3
>>>> ret = "Rain"
>>>> Case 4
>>>> ret = "Foggy and damp"
>>>> End Select
>>>> Return ret
>>>> End Function
>>>>
>>>> </script>
>>>> <html>
>>>> <body>
>>>> <h1>My weather forecast page</h1>
>>>> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
>>>> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
>>>> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
>>>> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
>>>> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
>>>> </body>
>>>> </html>
>>>>
>>>>
>>>> my operating system is Windows XP profesional. I use Internet
>>>> Information Services 5.1 (IIS).
>>>>
>>>> When I run this page in a webbrowser, the function 'GetForecast'
>>>> doesn't display anything ( no error's). All I see is the HTML text.
>>>> What can I be doing wrong? I got this code from a tutorial.
>>>> Is the code incorrect? Can IIS have incorrect settings?
>>>>
>>>> Thanks.
>>>
>>>
>>
>>
re:
> Thanks.

You're very much welcome!
Glad it worked!

re:
> Someone already installed .NET Framework. Doesn't make sense ASP.NET needs
> a seperate installement.

Maybe someone uninstalled/reinstalled IIS ?
That would require re-registering ASP.NET with the new IIS.

re:
> 3 cheers for spain!

Make that the Dominican Republic... ;-)

Happy coding!
Don't let the bug(ger)s get you!

:-)

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

"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:-b6dnYlGzYMPDaTfRVnyiw@dotnet.itags.org.casema.nl...
>> If you are, and it still doesn't work, try re-registering ASP.NET
>> from the .NET framework's main directory :
>>
>> aspnet_regiis -i
> It worked....but weird. Someone already installed .NET Framework. Doesn't
> make sense ASP.NET needs a seperate installement...I wasn't there when it
> was installed on my comp, maybe you can select an option during
> installation that you don't want to install ASP.NET.
> 3 cheers for spain!
> Thanks.

>> ( You did install the .NET Framework, right ? )
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> http://asp.net.do/foros/
>> Foros de ASP.NET en Espaol
>> Ven, y hablemos de ASP.NET...
>> ======================
>>
>> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
>> news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
>>> You mean something like this, it does not work either:
>>>
>>> <html>
>>>
>>> <script language="VB" runat="server">
>>> Sub Page_Load(Sender As Object, E As EventArgs)
>>> Message.Text = "You last accessed this page at: " &
>>> DateTime.Now
>>> End Sub
>>> </script>
>>>
>>> <body>
>>> <h3><font face="Verdana">Manipulating Server Controls</font></h3>
>>> This sample demonstrates how to manipulate the <asp:label>
>>> server control within
>>> the Page_Load event to output the current time.
>>> <p>
>>> <hr>
>>> <asp:label id="Message" font-size="24" font-bold="true"
>>> runat=server/>
>>> </body>
>>> </html>
>>>
>>>
>>> I see the HTML in the browser, but not the Message.Text in the label
>>> control.
>>>
>>>
>>> "Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
>>> news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
>>>> You need to enclose your frunctions within
>>>>
>>>> Sub
>>>>
>>>> End Sub
>>>>
>>>> statements.
>>>>
>>>> If you want the code to execut automatically
>>>> when the page loads, use Sub Page_Load :
>>>>
>>>> <script runat="server">
>>>> Sub Page_Load(Src as Object, e As System.EventArgs)
>>>>
>>>> ...rest of your code
>>>>
>>>> End Sub
>>>> <//script>
>>>>
>>>> best,
>>>>
>>>>
>>>> Juan T. Llibre
>>>> ASP.NET MVP
>>>> http://asp.net.do/foros/
>>>> Foros de ASP.NET en Espaol
>>>> Ven, y hablemos de ASP.NET...
>>>> ======================
>>>>
>>>> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
>>>> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>>>>> Ok,
>>>>>
>>>>> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
>>>>>
>>>>> <%@dotnet.itags.org. Page language="VB" %>
>>>>> <script runat="server">
>>>>
>>>>> Shared rand As Random = New Random()
>>>>> Function GetForecast(zip As String) As String
>>>>> Dim ret As String = String.Empty
>>>>> Select rand.Next(5)
>>>>> Case 0
>>>>> ret = "Sunny and warm"
>>>>> Case 1
>>>>> ret = "Partly cloudy and chilly"
>>>>> Case 2
>>>>> ret = "Cold with a chance of snow"
>>>>> Case 3
>>>>> ret = "Rain"
>>>>> Case 4
>>>>> ret = "Foggy and damp"
>>>>> End Select
>>>>> Return ret
>>>>> End Function
>>>>>
>>>>> </script>
>>>>> <html>
>>>>> <body>
>>>>> <h1>My weather forecast page</h1>
>>>>> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
>>>>> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
>>>>> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
>>>>> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
>>>>> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
>>>>> </body>
>>>>> </html>
>>>>>
>>>>>
>>>>> my operating system is Windows XP profesional. I use Internet
>>>>> Information Services 5.1 (IIS).
>>>>>
>>>>> When I run this page in a webbrowser, the function 'GetForecast'
>>>>> doesn't display anything ( no error's). All I see is the HTML text.
>>>>> What can I be doing wrong? I got this code from a tutorial.
>>>>> Is the code incorrect? Can IIS have incorrect settings?
>>>>>
>>>>> Thanks.
>>>>
>>>>
>>>
>>>
>>
>>

The beginning.

Ok,
I have a file 'WeatherPage.aspx' with the following code, basic stuff:
<%@dotnet.itags.org. Page language="VB" %>
<script runat="server">
Shared rand As Random = New Random()
Function GetForecast(zip As String) As String
Dim ret As String = String.Empty
Select rand.Next(5)
Case 0
ret = "Sunny and warm"
Case 1
ret = "Partly cloudy and chilly"
Case 2
ret = "Cold with a chance of snow"
Case 3
ret = "Rain"
Case 4
ret = "Foggy and damp"
End Select
Return ret
End Function
</script>
<html>
<body>
<h1>My weather forecast page</h1>
<p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
<p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
<p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
<p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
<p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
</body>
</html>
my operating system is Windows XP profesional. I use Internet Information
Services 5.1 (IIS).
When I run this page in a webbrowser, the function 'GetForecast' doesn't
display anything ( no error's). All I see is the HTML text. What can I be
doing wrong? I got this code from a tutorial.
Is the code incorrect? Can IIS have incorrect settings?
Thanks.The browser does give an error: Line 4, ";" is expected.
Isn't ";" used for "C#".
Page language is set to "VB".
"Qwert" <nosp@dotnet.itags.org.nosp.com> schreef in bericht
news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
> Ok,
> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
> <%@dotnet.itags.org. Page language="VB" %>
> <script runat="server">
> Shared rand As Random = New Random()
> Function GetForecast(zip As String) As String
> Dim ret As String = String.Empty
> Select rand.Next(5)
> Case 0
> ret = "Sunny and warm"
> Case 1
> ret = "Partly cloudy and chilly"
> Case 2
> ret = "Cold with a chance of snow"
> Case 3
> ret = "Rain"
> Case 4
> ret = "Foggy and damp"
> End Select
> Return ret
> End Function
> </script>
> <html>
> <body>
> <h1>My weather forecast page</h1>
> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
> </body>
> </html>
>
> my operating system is Windows XP profesional. I use Internet Information
> Services 5.1 (IIS).
> When I run this page in a webbrowser, the function 'GetForecast' doesn't
> display anything ( no error's). All I see is the HTML text. What can I be
> doing wrong? I got this code from a tutorial.
> Is the code incorrect? Can IIS have incorrect settings?
> Thanks.
>
You need to enclose your frunctions within
Sub
End Sub
statements.
If you want the code to execut automatically
when the page loads, use Sub Page_Load :
<script runat="server">
Sub Page_Load(Src as Object, e As System.EventArgs)
...rest of your code
End Sub
<//script>
best,
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
> Ok,
> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
> <%@dotnet.itags.org. Page language="VB" %>
> <script runat="server">

> Shared rand As Random = New Random()
> Function GetForecast(zip As String) As String
> Dim ret As String = String.Empty
> Select rand.Next(5)
> Case 0
> ret = "Sunny and warm"
> Case 1
> ret = "Partly cloudy and chilly"
> Case 2
> ret = "Cold with a chance of snow"
> Case 3
> ret = "Rain"
> Case 4
> ret = "Foggy and damp"
> End Select
> Return ret
> End Function
> </script>
> <html>
> <body>
> <h1>My weather forecast page</h1>
> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
> </body>
> </html>
>
> my operating system is Windows XP profesional. I use Internet Information
> Services 5.1 (IIS).
> When I run this page in a webbrowser, the function 'GetForecast' doesn't
> display anything ( no error's). All I see is the HTML text. What can I be
> doing wrong? I got this code from a tutorial.
> Is the code incorrect? Can IIS have incorrect settings?
> Thanks.
You mean something like this, it does not work either:
<html>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Message.Text = "You last accessed this page at: " & DateTime.Now
End Sub
</script>
<body>
<h3><font face="Verdana">Manipulating Server Controls</h3>
This sample demonstrates how to manipulate the <asp:label>
server control within
the Page_Load event to output the current time.
<p>
<hr>
<asp:label id="Message" font-size="24" font-bold="true"
runat=server/>
</body>
</html>
I see the HTML in the browser, but not the Message.Text in the label
control.
"Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
> You need to enclose your frunctions within
> Sub
> End Sub
> statements.
> If you want the code to execut automatically
> when the page loads, use Sub Page_Load :
> <script runat="server">
> Sub Page_Load(Src as Object, e As System.EventArgs)
> ...rest of your code
> End Sub
> <//script>
> best,
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>
>
I just pasted your code into
http://asp.net.do/test/vbtest2.aspx
It works fine.
Are you using http://localhost/virtualdirectory/yourfile.aspx ?
Or http://localhost/yourfile.aspx ?
Or http://YourComputerName/virtualdirectory/yourfile.aspx ?
Or http://yourserver.com/directory/yourfile.aspx ?
If you are, and it still doesn't work, try re-registering ASP.NET
from the .NET framework's main directory :
aspnet_regiis -i
( You did install the .NET Framework, right ? )
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
> You mean something like this, it does not work either:
> <html>
> <script language="VB" runat="server">
> Sub Page_Load(Sender As Object, E As EventArgs)
> Message.Text = "You last accessed this page at: " &
> DateTime.Now
> End Sub
> </script>
> <body>
> <h3><font face="Verdana">Manipulating Server Controls</h3>
> This sample demonstrates how to manipulate the <asp:label>
> server control within
> the Page_Load event to output the current time.
> <p>
> <hr>
> <asp:label id="Message" font-size="24" font-bold="true"
> runat=server/>
> </body>
> </html>
>
> I see the HTML in the browser, but not the Message.Text in the label
> control.
>
> "Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
> news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
>
> If you are, and it still doesn't work, try re-registering ASP.NET
> from the .NET framework's main directory :
> aspnet_regiis -i
It worked....but weird. Someone already installed .NET Framework. Doesn't
make sense ASP.NET needs a seperate installement...I wasn't there when it
was installed on my comp, maybe you can select an option during installation
that you don't want to install ASP.NET.
3 cheers for spain!
Thanks.

> ( You did install the .NET Framework, right ? )
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
> news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
>
re:
> Thanks.
You're very much welcome!
Glad it worked!
re:
> Someone already installed .NET Framework. Doesn't make sense ASP.NET needs
> a seperate installement.
Maybe someone uninstalled/reinstalled IIS ?
That would require re-registering ASP.NET with the new IIS.
re:
> 3 cheers for spain!
Make that the Dominican Republic... ;-)
Happy coding!
Don't let the bug(ger)s get you!
:-)
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:-b6dnYlGzYMPDaTfRVnyiw@dotnet.itags.org.casema.nl...
> It worked....but weird. Someone already installed .NET Framework. Doesn't
> make sense ASP.NET needs a seperate installement...I wasn't there when it
> was installed on my comp, maybe you can select an option during
> installation that you don't want to install ASP.NET.
> 3 cheers for spain!
> Thanks.

>

The Best Way (A Design Question)

Hello forum,

This is a question on the best approach to adopt to solve the following problem.

I have a list of names in one column and a numerical value in another. The table is then sorted by the second column largest to smallest.

When the database is updated, and the numbers in the second column change, I what to be able to display the amount by which a name has moved. Basically like a music chart would.

Yesterday Today
Smith 32 Jones 33 (+1)
Jones 32 Smith 32 (-1)
Lee 20 Cook 21 (+3)
Burns 20 Lee 20 (-1)
Payne 20 Burns 20 (-1)
Harris 20 Payne 20 (-1)
Cook 20 Harris 20 (-1)

To start, I guess I need a way of making a footprint of the values previous to the new update?

Any ideas would be gratefully received,
Thanks
Harold Clements

i'd say that you should make another column with the last number or do thecomputation in your code and save it in a column of the table.


That is the way I would approach it would be to have another column for the previous position then calculate the difference. Should be simple enough

Wednesday, March 28, 2012

The command prompt

following a book which says to use the command prompt to sign an assembly with a strong name. Im using visual studio for this project.

umm where can i find the command prompt to use for this?> umm where can i find the command promp

start->run->cmd.exe

j
You can either open the command prompt from within Visual Studio menu or Start -> Run -> cmd

Hope that helps
Kashif
Huh?
I thought you cant use regular DOS command prompt to sign an assembly. I alway use Visual Studio .NET command prompt.

The compiler failed with error code -1073741819.

Anyone,
I have an ASP.NET webapp in the 1.0 framework that has been working for
the past 2ish years.
Two ws ago a new developer received the following error when trying
to run the app in debug mode.
"The instruction at "0x77f57ec6" referenced memory at "0x797800004".
The memory could not be "written".

>From the IDE, before I attempt to run in debug mode I can "right click"
a given aspx file and "View Code". I can also "right click" and "View
in Designer". When I attempt to "right click" and "View in Browser" I
receive the following error:
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.
The detailed Compiler Output is as follows:
C:\WINDOWS\system32>
"c:\windows\microsoft.net\framework\v1.0.3705\vbc.exe" /t:library
/utf8output
/R:" c:\windows\assembly\gac\crystaldecisions
.web\9.1.3300.0__692fbea5521e130
4\crystaldecisions.web.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\5642a9da\c0eb1c67_a2aa
c501\xsm2.dll"
/R:" c:\windows\assembly\gac\crystaldecisions
.crystalreports.engine\9.1.3300.
0__692fbea5521e1304\crystaldecisions.crystalreports.engine.dll"
/R:"c:\windows\assembly\gac\system.web.services\1.0.3300.0__b03f5f7f11d50a3a
\system.web.services.dll"
/R:"c:\windows\assembly\gac\system.drawing\1.0.3300.0__b03f5f7f11d50a3a\syst
em.drawing.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\d898667e\c40d926c_a2aa
c501\nexsurex.dll"
/R:"c:\windows\assembly\gac\system.xml\1.0.3300.0__b77a5c561934e089\system.x
ml.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\430dcb9f\147ce564_a2aa
c501\xaccounting.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\2c66c8b1\6c3aaed6_9baa
c501\controls.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\6834c7bf\32afd8a9_9baa
c501\dalplugindetailedlog.dll"
/R:" c:\windows\assembly\gac\crystaldecisions
.reportsource\9.1.3300.0__692fbe
a5521e1304\crystaldecisions.reportsource.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\dade88bd\0060bd99_534f
c201\interop.vba.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\9f86c1cb\0ac2eba9_9baa
c501\xdom3.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\b0170de4\b0608c65_a2aa
c501\commonlib.dll"
/R:" c:\windows\assembly\gac\crystaldecisions
.shared\9.1.3300.0__692fbea5521e
1304\crystaldecisions.shared.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\1edb7ee1\f99ae4a9_9baa
c501\xdba3.dll"
/R:"c:\windows\assembly\gac\system.data\1.0.3300.0__b77a5c561934e089\system.
data.dll"
/R:"c:\windows\assembly\gac\system.enterpriseservices\1.0.3300.0__b03f5f7f11
d50a3a\system.enterpriseservices.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\7996cee9\e873dda9_9baa
c501\vcrpagenavigator.dll"
/R:"c:\windows\assembly\gac\system\1.0.3300.0__b77a5c561934e089\system.dll"
/R:"c:\windows\assembly\gac\system.web\1.0.3300.0__b03f5f7f11d50a3a\system.w
eb.dll"
/R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\93ce11ca\a67a0465_a2aa
c501\xdti.webcontols.dll"
/out:"C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET
Files\nexsurex_working\cd5673eb\1b418a67
\thy6lfor.dll" /D:DEBUG=1
/debug+ "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\Temporary
ASP.NET Files\nexsurex_working\cd5673eb\1b418a67
\thy6lfor.0.vb"
Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.00.3705.288
Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.
The first developer who was receiving this issue had IT rebuild the
box, and the problem went away for a day or two, but came back. He is
currently on the third rebuild, with the application working for three
consecutive days.
With this now happening on my machine, I believe this to be an
application issue, not hardware.
Any help would be greatly appreciated.Check your hard disk(s) for errors.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
<robert_m_fisher@dotnet.itags.org.yahoo.com> wrote in message
news:1125104686.827098.248920@dotnet.itags.org.g14g2000cwa.googlegroups.com...
> Anyone,
> I have an ASP.NET webapp in the 1.0 framework that has been working for
> the past 2ish years.
> Two ws ago a new developer received the following error when trying
> to run the app in debug mode.
> "The instruction at "0x77f57ec6" referenced memory at "0x797800004".
> The memory could not be "written".
>
> a given aspx file and "View Code". I can also "right click" and "View
> in Designer". When I attempt to "right click" and "View in Browser" I
> receive the following error:
> 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.
> The detailed Compiler Output is as follows:
> C:\WINDOWS\system32>
> "c:\windows\microsoft.net\framework\v1.0.3705\vbc.exe" /t:library
> /utf8output
> /R:" c:\windows\assembly\gac\crystaldecisions
.web\9.1.3300.0__692fbea5521e1
304\crystaldecisions.web.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\5642a9da\c0eb1c67_a2
aac501\xsm2.dll"
> /R:" c:\windows\assembly\gac\crystaldecisions
.crystalreports.engine\9.1.330
0.0__692fbea5521e1304\crystaldecisions.crystalreports.engine.dll"
> /R:"c:\windows\assembly\gac\system.web.services\1.0.3300.0__b03f5f7f11d50a
3a\system.web.services.dll"
> /R:"c:\windows\assembly\gac\system.drawing\1.0.3300.0__b03f5f7f11d50a3a\sy
stem.drawing.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\d898667e\c40d926c_a2
aac501\nexsurex.dll"
> /R:"c:\windows\assembly\gac\system.xml\1.0.3300.0__b77a5c561934e089\system
.xml.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\430dcb9f\147ce564_a2
aac501\xaccounting.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\2c66c8b1\6c3aaed6_9b
aac501\controls.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\6834c7bf\32afd8a9_9b
aac501\dalplugindetailedlog.dll"
> /R:" c:\windows\assembly\gac\crystaldecisions
.reportsource\9.1.3300.0__692f
bea5521e1304\crystaldecisions.reportsource.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\dade88bd\0060bd99_53
4fc201\interop.vba.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\9f86c1cb\0ac2eba9_9b
aac501\xdom3.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\b0170de4\b0608c65_a2
aac501\commonlib.dll"
> /R:" c:\windows\assembly\gac\crystaldecisions
.shared\9.1.3300.0__692fbea552
1e1304\crystaldecisions.shared.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\1edb7ee1\f99ae4a9_9b
aac501\xdba3.dll"
> /R:"c:\windows\assembly\gac\system.data\1.0.3300.0__b77a5c561934e089\syste
m.data.dll"
> /R:"c:\windows\assembly\gac\system.enterpriseservices\1.0.3300.0__b03f5f7f
11d50a3a\system.enterpriseservices.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\7996cee9\e873dda9_9b
aac501\vcrpagenavigator.dll"
> /R:"c:\windows\assembly\gac\system\1.0.3300.0__b77a5c561934e089\system.dll
"
> /R:"c:\windows\assembly\gac\system.web\1.0.3300.0__b03f5f7f11d50a3a\system
.web.dll"
> /R:"c:\windows\microsoft.net\framework\v1.0.3705\temporary asp.net
> files\nexsurex_working\cd5673eb\1b418a67
\assembly\dl2\93ce11ca\a67a0465_a2
aac501\xdti.webcontols.dll"
> /out:"C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET
> Files\nexsurex_working\cd5673eb\1b418a67
\thy6lfor.dll" /D:DEBUG=1
> /debug+ "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\Temporary
> ASP.NET Files\nexsurex_working\cd5673eb\1b418a67
\thy6lfor.0.vb"
>
> Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
> for Microsoft (R) .NET Framework version 1.00.3705.288
> Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.
> The first developer who was receiving this issue had IT rebuild the
> box, and the problem went away for a day or two, but came back. He is
> currently on the third rebuild, with the application working for three
> consecutive days.
> With this now happening on my machine, I believe this to be an
> application issue, not hardware.
> Any help would be greatly appreciated.

Monday, March 26, 2012

The conversion of a char data type to a datetime data type resulted....

Hi,

I'm trying to insert a date time value into a SQL Server Database field of type date time using a c# web form.
I get the following error...
"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated"

My SQL looks like this:


INSERT INTO tblname (fldname) VALUES ('" + DateTime.Now.ToString() + "')"

What am I doing wrong?Remove the ToString() method as that is changing the DateTime type to a string (or Char type) ...at least thats what it looks like.
Nope sorry to say that didn't work.

My C# now looks like


SqlConnection myConn = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["eTeam_ConnectionString"].ToString());
string mySQL = "INSERT INTO tblname (datestamp) VALUES ('" + DateTime.Now + "')";
SqlCommand myCMD = new SqlCommand(mySQL, myConn);
myConn.Open();
myCMD.ExecuteNonQuery();
myConn.Close();
myCMD.Dispose();
myConn.Dispose();

And the field 'datestamp' is a SQL Server Data Type datetime

Anyone else?
You can use getDate() method of SQL server to update date.

INSERT INTO tblname (datestamp) VALUES (getDate())";
Thanks for that - definately half way to solving my problem.
What if I need to take a value from an ASP:Calendar control?
Is there a ToDate() function that will convert it as required?
You can use

Calendar1.SelectedDate.ToShortDateString())

which will convert this date into short date format.

Saturday, March 24, 2012

The data is invalid - windows media player error

I cannot seem to get a wmv file to stream from asp.net. I have tried
the following code.
I need to be able to use either response.outpustream or
response.binarywrite since
I will be getting the file from an sql server image field. Other types
of files such as gif or pdf work fine. Here is the code for the wmv:
Dim sql As String
sql = "select * from TblBlobs where blob_id = " & iBlobId
Dim da As New SqlDataAdapter(sql, cn)
Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
Dim ds As New DataSet
cn.Open()
da.Fill(ds, "Default")
Dim myRow As DataRow
myRow = ds.Tables("Default").Rows(0)
Dim MyData() As Byte
MyData = myRow("filedata")
Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = False
Response.ContentType = "video/x-ms-wmv"
Response.OutputStream.Write(MyData, 0, MyData.Length)
Response.Flush()
Response.Close()
MyCB = Nothing
ds = Nothing
da = Nothing
cn.Close()
cn = Nothing
When the user clicks on a button to run this code, the error "The data
is invalid" is displayed from windows media player. I cannot figure
out what is specific about wmv's that they will not stream.
Thanks Before Hand,
AdielUpdate:
The error when testing on system with Windows Media Player Version
7.10.00.3077 is "The data is invalid"
The error when testing on system with Windows Media Player Version
10.00.00.3700 is "Windows Media Player cannot play the file. The
Player might not support the file type or might not support the codec
that was used to compress the file." and if you click on "More
Information", the error is "C00D1199: Cannot play the file" Error ID =
0xC00D1199, Condition ID = 0x00000000.
Thanks,
Adiel

The data is invalid - windows media player error

I cannot seem to get a wmv file to stream from asp.net. I have tried
the following code.
I need to be able to use either response.outpustream or
response.binarywrite since
I will be getting the file from an sql server image field. Other types
of files such as gif or pdf work fine. Here is the code for the wmv:

Dim sql As String

sql = "select * from TblBlobs where blob_id = " & iBlobId

Dim da As New SqlDataAdapter(sql, cn)
Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
Dim ds As New DataSet

cn.Open()
da.Fill(ds, "Default")
Dim myRow As DataRow
myRow = ds.Tables("Default").Rows(0)

Dim MyData() As Byte
MyData = myRow("filedata")

Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = False

Response.ContentType = "video/x-ms-wmv"

Response.OutputStream.Write(MyData, 0, MyData.Length)
Response.Flush()
Response.Close()

MyCB = Nothing
ds = Nothing
da = Nothing

cn.Close()
cn = Nothing

When the user clicks on a button to run this code, the error "The data
is invalid" is displayed from windows media player. I cannot figure
out what is specific about wmv's that they will not stream.

Thanks Before Hand,
AdielCAn you scesfully download the WMV file.

"adiel_g@dotnet.itags.org.hotmail.com" wrote:

> I cannot seem to get a wmv file to stream from asp.net. I have tried
> the following code.
> I need to be able to use either response.outpustream or
> response.binarywrite since
> I will be getting the file from an sql server image field. Other types
> of files such as gif or pdf work fine. Here is the code for the wmv:
>
> Dim sql As String
> sql = "select * from TblBlobs where blob_id = " & iBlobId
> Dim da As New SqlDataAdapter(sql, cn)
> Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
> Dim ds As New DataSet
> cn.Open()
> da.Fill(ds, "Default")
> Dim myRow As DataRow
> myRow = ds.Tables("Default").Rows(0)
> Dim MyData() As Byte
> MyData = myRow("filedata")
> Response.ClearContent()
> Response.ClearHeaders()
> Response.Buffer = False
> Response.ContentType = "video/x-ms-wmv"
> Response.OutputStream.Write(MyData, 0, MyData.Length)
> Response.Flush()
> Response.Close()
> MyCB = Nothing
> ds = Nothing
> da = Nothing
> cn.Close()
> cn = Nothing
>
> When the user clicks on a button to run this code, the error "The data
> is invalid" is displayed from windows media player. I cannot figure
> out what is specific about wmv's that they will not stream.
> Thanks Before Hand,
> Adiel
>
No, if I click on the link and choose "Save target as", the error is:

Internet Explorer cannot down from ... _ctl18$lnkLoadImageItem','').

I can understand the above error because the system has to call the
function before it can actually download the file. Basically the
function above is being called from a LinkButton. I have also tried
calling the function from a regular button and same results: I can load
gifs, pdfs, jpgs, etc but windows video files (wmv) receive the error
"The data is invalid" when the system starts Windows Media Player.
Update:

The error when testing on system with Windows Media Player Version
7.10.00.3077 is "The data is invalid"

The error when testing on system with Windows Media Player Version
10.00.00.3700 is "Windows Media Player cannot play the file. The
Player might not support the file type or might not support the codec
that was used to compress the file." and if you click on "More
Information", the error is "C00D1199: Cannot play the file" Error ID =
0xC00D1199, Condition ID = 0x00000000.

Thanks,
Adiel

The error code for the failure is 80070545

I'm getting the following error after installing the .NET Framework 1.1. Do
anyone have a solution?

"aspnet_wp.exe could not be started. The error code for the failure is
80070545. This error can be caused when the worker process account has
insufficient rights to read the .NET Framework files. Please ensure that the
..NET Framework is correctly installed and that the ACLs on the installation
directory allow access to the configured account."Check ASP.NET account in local users group of your machine. And make sure
that this user has enough rights to access web-server directory.

"jfleeson" <james.fleeson@.roseheartinn.com> wrote in message
news:Op$BQFnJFHA.3420@.tk2msftngp13.phx.gbl...
> I'm getting the following error after installing the .NET Framework 1.1.
> Do
> anyone have a solution?
> "aspnet_wp.exe could not be started. The error code for the failure is
> 80070545. This error can be caused when the worker process account has
> insufficient rights to read the .NET Framework files. Please ensure that
> the
> .NET Framework is correctly installed and that the ACLs on the
> installation
> directory allow access to the configured account."

Thursday, March 22, 2012

The error code for the failure is 80070545

I'm getting the following error after installing the .NET Framework 1.1. Do
anyone have a solution?
"aspnet_wp.exe could not be started. The error code for the failure is
80070545. This error can be caused when the worker process account has
insufficient rights to read the .NET Framework files. Please ensure that the
.NET Framework is correctly installed and that the ACLs on the installation
directory allow access to the configured account."Check ASP.NET account in local users group of your machine. And make sure
that this user has enough rights to access web-server directory.
"jfleeson" <james.fleeson@.roseheartinn.com> wrote in message
news:Op$BQFnJFHA.3420@.tk2msftngp13.phx.gbl...
> I'm getting the following error after installing the .NET Framework 1.1.
> Do
> anyone have a solution?
> "aspnet_wp.exe could not be started. The error code for the failure is
> 80070545. This error can be caused when the worker process account has
> insufficient rights to read the .NET Framework files. Please ensure that
> the
> .NET Framework is correctly installed and that the ACLs on the
> installation
> directory allow access to the configured account."
>

The file web.sitemap required by XmlSiteMapProvider does not exist.

hi,

Ive seen a post above the subject in my search on the forum. My XMLFile1 has the following data in it which I copied from the thread. Now if im on a virtual directory what shall I put as sitemap and how shall I connect the sitemap with the xml file please

<?xml version="1.0" encoding="utf-8" ?>

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<siteMapNode url="Default.aspx" title="Geekpedia" description="Home Page of Geekpedia.com ">

<siteMapNode url="Register.aspx" title="Registration" description="Register a new account." />

<siteMapNode url="SignIn.aspx" title="Sign-In" description="Sign-in into your existing account." />

</siteMapNode>

</siteMap><bump>
Get your XmlDataSource to point to XmlFile1.xml. (The datafile property)

The first application gives server load error

I'm new to asp.net. Started following a book, I created a FirstApplication and when i try to run it on the browser it gives me the server parse error 'firstapplication.global file not loaded'. Error line 1.
I have not changed anything except for adding a header in the global.aspx file in between the form tags. also the application did'nt create the .vsdisco file. Heard vs2003 does'nt create one. Does it have to do anything with it. Help please!!!!!!!!!!!a header in global.aspx ?
global.aspx to my knowledge isnt used for anything other than writing
applicaiton onstart... on end... session on start and on end etc...
you just write methods for each in global file.
remove the header (cause i dont know y you are adding that header)
open the code file... gloabal.aspx.cs or vb

save the project... build it... and run it...

HTH

HD

"BSL" <anonymous@.discussions.microsoft.com> wrote in message
news:C4D05D3F-F9B6-44F2-B649-A78B81844844@.microsoft.com...
> I'm new to asp.net. Started following a book, I created a FirstApplication
and when i try to run it on the browser it gives me the server parse error
'firstapplication.global file not loaded'. Error line 1.
> I have not changed anything except for adding a header in the global.aspx
file in between the form tags. also the application did'nt create the
..vsdisco file. Heard vs2003 does'nt create one. Does it have to do anything
with it. Help please!!!!!!!!!!!

The first application gives server error

> I'm new to asp.net. Started following a book, I created a FirstApplicatio
and when i try to run it on the browser it gives me the following server parse erro

----
Could not load type FirstApplication.Globa

<%@dotnet.itags.org. Application Codebehind="Global.asax.vb" Inherits="FirstApplication.Global"%

Source File :c:\inetpub\wwwroot\FirstApplication\global.asax Line: 1

-------
> I have not changed anything except for adding a header in the webform1.asp
file in between the form tags. Am I missing anything here

Help please!!!!!!!!!!It also did not create any files in the bin directory. n
..dll and .pdb files. Wondering why?
open the global.asax.vb (right click global.asax click view code...)... save
it..

do a recompile of the app... and give it a try...

--
Regards,

HD

"BSL" <anonymous@.discussions.microsoft.com> wrote in message
news:BF9D7CFC-3259-4154-ADF5-7426E52B9F87@.microsoft.com...
> It also did not create any files in the bin directory. no
> .dll and .pdb files. Wondering why?

Tuesday, March 13, 2012

The main Issue on Browse folder in Web application??

Hi,
I want to phrase my problem in a new way that the following code works well on the same system on debugging mode of the project but If I want to copy the url of the project and paste into new browser window without debugging mode, then the problem arises that Its shows progressing the browse folder dialog box does not appears any how. So If any one have the solution of my problem please reply me soon...
I written earlier on this topic shown below...
-----
I am facing a problem of browse folder. Its working fine on loacalhost but when I upload my project into my client's server, the browse folder dialog box does not appears any how. It giving no error but browser progress bar shows progressing...
Is the reason behind this is I have used Shell32.dll for browse folder.. Or there is another way of implementing browse folder functionality on my project..
Thanks
following is mine code
-----------------
Using shell32;
protected void AddFolder_Click(object sender, EventArgs e)
{
string strPath = "";
string strCaption = "Browse a directory for uploading Album.";
//DialogResult dlgResult;
string dlgResult = "";
Shell32.ShellClass shl = new Shell32.ShellClass();
Shell32.Folder2 fld = (Shell32.Folder2)shl.BrowseForFolder(0, strCaption, 0, System.Reflection.Missing.Value);
if (fld == null)
{
dlgResult = "Cancel";//DialogResult.Cancel;
}
else
{
strPath = fld.Self.Path;
lstboxFile.Items.Add(strPath);
//strPath = "albums\\MSN Home Page";
lstboxFile.Items.Add(strPath);
BaydonConstants.hif1.Add(strPath);
dlgResult = "Ok";//DialogResult.OK;
}
}

-----------------

Looks like the problem you are facing is due to security permissions in that folder, please do check on IIS folder permissions as well as the user running under IIS has enough access to that folder.

Merry Xmas


In what kind of environment are you using this? You can't use the shell classes in ASP.NET.


I am using it in a web application which have to run on LAN.

Hi,

Based on my understanding, you want to upload the whole folder and need to show the Directory OpenDialoge. If I have misunderstood you, please feel free to let me know.

As far as I know, you can't achieve this by using the codes above but it can be implemented by ActiveX which is unusual approach we use.

Instead of it, usually we useZip the files ormutiple filesupload to achieve it. There are two links as followings about uploading mutiple files.

http://www.codeproject.com/KB/aspnet/multiuploads.aspx

http://www.codeproject.com/aspnet/FlashUpload.asp

Or you can try thisscript about upload folder:http://scriptbuilders.net/files/uploadfolderaction1.0.html

Hope it helps.