Vb.net code in asp.net 2.0: works on hosts win 2003asp.net 2.0 server, crashes on xp asp.net offline workstation

Hi All

 Can anyone tell me whats wrong with this code ?

 Dim WeeklyRentalMinT as double = txtminrent.text

 I 've been using code similar or identical to that since I started experimenting with ASP 3.0 in 2004

its worked every time, yet I now wonder if it contributed to slowing down my apps,

we'll the code works on my host server, it worked on my pc when it was running asp.net 1.1, but

now that i've upgraaded to asp.net 2.0, i get an error

"[FormatException: Input string was not in a correct format.]"

 How would you read input from a form textbox into a variable for manipulation or insertion into a database ?

 I must say asp.net 2.0 is making me code very differently

 

Cheers all

0
costrak
6/5/2007 2:21:33 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

2 Replies
1534 Views

Similar Articles

[PageSpeed] 20

Hi All

 I found the code below on msdn , modified it an used it, but no show,  it gives the same error message on line 4, so i am left wondering

 txtminrent  is a textbox control

<asp:TextBox  ID="txtminrent" Width="155" Runat="server" />

Dim WeeklyRentalMinTtxt as textbox = txtminrent
Dim WeeklyRentalMinTstr as string = WeeklyRentalMinTtxt.text
Dim WeeklyRentalMinT as double  

WeeklyRentalMinT =System.Convert.ToDouble(WeeklyRentalMinTstr) 

 

0
costrak
6/5/2007 5:26:40 PM

This is the only code you will need: 

Dim WeeklyRentalMinT As Double = Convert.ToDouble(txtminrent.Text)

txtminrent is already defined as a TextBox in your ASPX code. The Text value in the textbox must be a valid number though. If it is empty or any other character other than a number and a decimal place you will still get that error. This is where you place a RequiredField validation control and a CompareValidationControl for the textbox to make sure it has a valid value in it.

 

0
rstepan
6/5/2007 8:14:49 PM
Reply:

Similar Artilces:

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! Have a look into this links http://en.wikipedia.org/wiki/.NET_Framework http://blogs.msdn.com/mohammadakif/archive/2006/12/03/net-3-0-different-versions-of-the-net-framework.aspx http://www.codeproject.com/aspnet/ComparisonASP1xASP20.aspAshok Rajawww.iGold.inDon't forget to click "Mark as Answer" on the post that helped you. This credits that m...

.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

.NET 3.0 or .NET 2.0?
I'm going to move my exiting software to .net soon. I'm just wondering if I should wait for the .NET 3.0 framework to be released or if I can start with the 2.0 now? I'd say you can go ahead and move your code to .Net 2.0 as .Net 3.0 uses the CLR version 2.0.Basically, .net 3.0 is .net 2.0 PLUS some new features for presentation (GUI), communication and workflow process.  So the compiler as well as the language features used by the 2.0 runtime will be the same in 2.0 and 3.0"Never argue with an idiot; He will drag you down to his level and beat you with experienc...

Access .Net 2.0 Application from .Net 2.0 Web Site
I need to populate a specific form in a .Net desktop application from a .net web application.  Is there an easy way to go about this? Hi, Based on my understanding, you want to start an executable application from your ASP.NET websit, right? We can invoke Process.Start method (http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx) to launch an executable application from ASP.NET application. Note: Please keep in mind, the ASP.NET application is running on the server, so it will start the executable application that exists in the server.   I look...

Clickonce deployment anyone (DW.NET 2.0 and .NET 2.0)?
I saw someone had posted a question about this already, and there were no responses. So I am hoping that this will get some. We had problems with the previous version of DW.NET 1.5 + VS2003 when attempting to deploy applications via a web server. So many problems that we eventually decided to run off a network drive (which is OK if your user base doesn't roam around the country). Anyway, we gave up on DW.NET, and started to use the datagrid control. Since then, much has changed. Our development team now has VS2005 professional and may start using DW.NET 2.0 (pending my inv...

LDAP Authentication .Net 1.0 code to .Net 2.0
A few years ago with help of Dunry (I think he wrote most of the LDAP part) we came up with the below C# that works in our environment. We now need to migrate this to .Net 2.0.Does anyone have any examples of something simliar that works in .Net 2.0? Thanks in advance.private void btnSubmit_Click(object sender, System.EventArgs e)  {   if(Page.IsValid)   {    SearchDirectoryUsername(txtUsername.Text);   }  }  private void SearchDirectoryUsername(string username)  {   using ...

Code works with .Net 1.1 but not .Net 2.0
Can anyone offer any suggestions as to why this code would work under .Net 1.1 and not .Net 2.0? I listed the error I receive below, also. Line 865. Thank you, Public Function GetAge(ByVal Birthdate As System.DateTime, _ Optional ByVal AsOf As System.DateTime = #1/1/1700#) _ As Integer Dim iMonths As Integer Dim iYears As Integer Dim dYears As Decimal Dim lDayOfBirth As Long Dim lAsOf As Long Dim iBirthMonth As Integer Dim iAsOFMonth As Integer If AsOf = "#1/1/1700#" ...

.NET 2.0 Data Connection (.NET 2.0 Beta Data Provider)
I have installed the .NET 2.0 Beta Data Provider, in the server explorer in Visual Studio 2005 I have tried to connect to this provider but I can not see it in the list. Is there something else you need to do to see this other than what is in the instructions or is this not supported yet? Hi Dean, I assume you mean ASE ADO.NET 2.0 Beta. I'm attaching the html readme for this product that you should have from downloading it. Are you talking about using Server Explorer to see the Provider? This functionality isn't working yet and should be available on GA or shortly ...

what is new in vb net for Net 2.0 ?
where can I find an article with all what is new in vb net for Net 2.0 ? thank youangiras ???? http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbcn/html/d7e97396-7f42-4873-a81c-4ebcc4b6ca02.aspThanks,Teemu KeiskiFinland, EU...

Where is the ADO.NET Sybase driver for .NET 1.1 and .Net 2.0?
Hi All Does anyone know where I can get the Sybase drivers for ADO.NET for both versions, 1.1 and 2.0/3.0? Cheers Chris Burrell Hi Chris, There is no release of ASE ADO.NET Provider 2.0 (I assume you refer to ASE provider, not ASA - if ASA please port to sybase.public.sqlanywhere.general). For the 1.1 Provider: It is available in the ASE SDK for windows or the PC Client CDRom included with ASE product. On the SDK its available as 12.5.1 and 15.0 On ASE PC Client I think 12.5.1 is part of ASE 12.5.X and 15.0 is part of ASE 15.X 2.0 provider should release som...

web.config problems when upgrading from .NET 2.0 Beta to .NET 2.0 release version
We uninstalled .NET 2.0 Beta and replaced it with .NET 2.0 release version.  And it messed everything up.  All applications now give weird errors indicating the lack of web.config files, despite the fact that they already have web.config files in place.  For example, the following error occurs even though the web.config file has <customErrors="Off">: Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for securit...

Custom Paging .Net 2.0 to .Net 3.0
 I have a web app written in VS 2005 that uses griviews with custom paging and sorting done as follows. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="rec_id" BorderColor="White" BackColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" AllowPaging="True" AllowSorting="True" PageSize="20" OnSorting="Gvemp_sort&q...

.NET 2.0 and .NET 3.0 Running parallel
Are there any known issues for both of the frameworks running in parallel on same machine Also searched on the web but would like to know complete reference, before I dirty my hands on the 3.0.Any help is appreciated.regardsRaheel Hussain--------------------------------Blog: http://www.dnfug.com/web/blogs/raheel/URL: http://www.raheelhussain.com/--------------------------------This posting is provided "AS IS" with no warranties, and confers no rights. The 2.0 and 3.0 frameworks don't run separately, they run together.  Think of .NET 3.0 as an extension of 2.0, ...

Parse JSON vb.NET with .NET 2.0
I've looked and experimented for several hours and have had no luck.Im looking for a way to parse JSON objects sent from the clientside (javascript with AJAX) to the serverside (vb.net). I was hoping to find a function or class or something because I do not have the ability to install a library on the server.  have you looked at the following (I know you're looking vb.net so replace the using with imports and the declaration with dim or whatever) using System.Web.Script.Serialization;JavaScriptSerializer serializer = new JavaScriptSerializer(); HTH   &nbs...

Web resources about - Vb.net code in asp.net 2.0: works on hosts win 2003asp.net 2.0 server, crashes on xp asp.net offline workstation - asp.net.getting-started

Workstation - Wikipedia, the free encyclopedia
This article is about the type of computer. For workstations in music production, see music workstation . For furniture, see cubicle and computer ...

Workstation - Wikipedia, the free encyclopedia
This article is about the type of computer. For workstations in music production, see music workstation . For furniture, see cubicle and computer ...

App Store - iCAS — Workstation-class scientific computing for iOS devices!
Get iCAS — Workstation-class scientific computing for iOS devices! on the App Store. See screenshots and ratings, and read customer reviews. ...

workstation - Flickr - Photo Sharing!
i tend to photograph trin from above. possibly because she is little. colour

Citrix WinFrame 1.8 upgrade from Windows NT 3.51 Workstation - YouTube
This is my recording of doing an in place upgrade of the elusive Citrix WinFrame 1.8 version of Windows NT 3.51. I was able to do an in place ...

Active workstations
Active workstations mean we can burn calories and stay active while we sit.

Active workstations
Active workstations mean we can burn calories and stay active while we sit.

Active workstations
Active workstations mean we can burn calories and stay active while we sit.

Active workstations
Active workstations mean we can burn calories and stay active while we sit.

Fusion-IO Brings Flash Madness To Workstations, And Movies Like 'Hugo'
... the founding member of the AllThingsD Flash Madness Club , last summer’s hot IPO , said today it is bringing its flash technology to workstations. ...

Resources last updated: 12/23/2015 10:54:05 AM