.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

DropDownList error message: "value not found in the list"

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :ASP.Net

Inside a FormView control, I have a DropDownList that populates a SQL column with city names. The SQL column type is nchar(50) -- I set it for 50, since the city names can be short or very long. The DropDownList contains all the city names. When a new record is created in SQL via this FormView control, the DropDownList successfully populates the column cell.

However, when I try to edit that record (using the edit template in FormView), I get the above error message...I believe the retrieved entry is not matching the entry in the list, because SQL isn't just storing the number of characters that a given city has (say "6" for Boston), it is storing/retrieving 50 characters (6 + 44 null spaces = 50 characters)--and thus DropDownList doesn't recognize that the entry is just "Boston"...How can I resolve? How can I ensure that there are no extra spaces recorded in a SQL cell beyond what is needed to accomodate the name of any given city?  Is this a SQL task or can it be resolved in ASP.NET?  Thank you. 

View Complete Post

More Related Resource Links

Inserting personal error message in ValidationSummary



I am creating a web form that requires a lot of validation. I use many of the validation control in asp.net already like RequiredFieldValidator and CompareValidator. 

My Problem: after my custom validation for the value entered return an error message, and I pressed enter key when the field is empty, my custom error message is overlapped by my ValidationSummary. 

Setting my custom error to visible = false on button click also does not seem to work as it requires for me to enter the value first.

This made me think, is there a way to insert my custom validation inside the ValidationSummary as an error message like for other validation control?

Thanks in advance

create user wizard login error message dont show in a message box?




i am using create user wizard and capturing other information within content template when a new user

registers. Some of the textboxes are binded to required field validators.


there is a validation control on the page and ShowMessage box is True.

If they dont complete some of the text boxes then the message box pops Up with the error message.

It does not however include information errors like "User already exists" or Email address already exists

from the create user wizard membership  UserName and Password Textboxes


is it possilbe to hook all of these up so I get one message box with all errors including membership ones?




Very Basic Question - Error message running first page


Hi Everyone,

I am running Windows 7 and I have gone into Control Panel and activated all of the IIS Functions.

The web application I am running was downloaded from the net (and has worked on other machines previously).  Once I downloaded it, I moved it into C:/inetpub/wwwroot/code/main.asp

I am a bit of a novice at this!  But I am hoping someone can point me in the right direction!


I get the following error when I try and run the web application through IE:

"An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error."

(When i click the "click here" button it just goes to the IIS site).


Appreciate any help I can get!




DropDownList within FormView Error

I have a FormView which works find and I have added a new DropDownList within the form which references another table to which I need to select a value,
I have added the dropdownlist2 and setup a new connection string to this, when I run the page I get this error:

Could not find control 'DropDownList2' in ControlParameter 'CurrencyID'.

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

Exception Details: System.InvalidOperationException: Could not find control 'DropDownList2' in ControlParameter 'CurrencyID'.
any help would be greatly

Localize framework message from xml validation error


I need to validate an XML through XSD. I am using XMLReader (with XmlReaderSettings and 

Validation_EventHandler to do it). Depend on users preference, I would like to change the output message generated by  Validation_EventHandler in french or english.

Any idea on how to perform this?





Compiler Error Message : CS0006: Metadata file 'System.EnterpriseServices.dll' could not be found


I get this error when i Debug my web application....


I followed these steps.,

  • Ended the aspnet_wp.exe process in the Windows Task Manager
  • Then deleted the application`s folder in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
  • Then started Visual Studio 2008 again

I also rebooted my system but no use....

Plz help !

Error Message when trying to open crystal report


Logon failed. Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "DATA" requested by the login. The login failed. Error in File C:\Windows\TEMP\NewQuote {573CE511-64B7-4161-B9DF-0E58EB1EDA19}.rpt: Unable to connect: incorrect log on parameters.

I get the above message when loading the crystal report from the Intranet via IIS but it works fine from the localhost the report loads ok and picks up my parameters.  This is my Code behind Page.

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load

        Dim Count As Int32
        Count = Int32.Parse(Label1.Text)

        Dim ConnInfo As New ConnectionInfo
        With ConnInfo
            .ServerName = "\\Server1\Sqlexpress"
            .DatabaseName = "DATA"
            .UserID = "sa"
            .Password = "1181

Weird security configuration error message


Recently something has gone wrong with our website so that whenever you try to access an aspx file, it shows the following error:


Server Error in '/RALSWeb' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Access is denied: 'RalsWeb'.

Source Error:

Line 256:                <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 257:                <add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 258:                <add assembly="*"/>
Line 259:            </assemblies>

Parser Error Message: Could not load type MasterPage File



Server Error in '/' Application.

Parser Error

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

Parser Error Message: Could not load type 'wamsilverlight.Web.Wam'.

Source Error:

Line 1:  <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Wam.master.cs" Inherits="wamsilverlight.Web.Wam" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Source File: /Wam.Master    Line: 1

Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927


All of the following have been tried over and over again:

1.) Delete all existing .dlls

2.) Delete MasterPage File and recreate it.

3.) Delete MasterPage perform a c

Error message when selecting a row in webdatagrid



I have a webdatagrid control that is loaded by using an sqldatasource.  I have add and edit methods that behave correctly, however, I have a problem when I delete a row.   I can delete the row correctly from the datagrid and the database, but as soon as I select another row in the grid straight after, I get an error:

Microsoft JScript runtime error: 'undefined' is null or not an object


There are no events wired up to the row select, so it doesn't appear to be that.


Can anyone help?


override error message (The value 'test' is not valid for Age) when input incorrect data type for in


Hello everyone,

I've tried to override error message when input incorrect data type in input field on HTML form. For example I have the model like this.

public class Person
public string FirstName {get;set;}
public int Age {get;set;}


For view, I put text input for Age to get it value.

When type some string in Age text box like 'test' and press submit button. I got this error message

The value 'xxx' is not valid for Age

However, I want to change this message and try many way. There 's nothing effect this message value.

Please could you help me to solve this problem.

Importing Excel 2007 spreadsheet into WSS 3.0 -- Error Message



I'm trying to import (Custom Lists >> Import Spreadsheet) into WSS 3.0 and I'm getting the following message: 

Refers to the _layouts

You are not authorized to view this page.  You might not have permissions to view this direcotyr or page using the credentials you supplied. [More stuff here.]

Http ERror 403 - Forbidden

Is this just a permissions problem or is there some other underlying issue?  Should you be able to upload an Excel spreadsheet (with links) into a Custom List?


Thanks! Patti N.

Nintex Workflow Error: No workflows are waiting for a BizTalk message [...] No processing has been d



I created a Workflow with Nintex Workflow 2007 (on SharePoint 2007) to send/receive data to BizTalk 2009. It worked fine already. But now I get the following error mesage in the EventViewer:

Nintex Workflow; Build: 11000 (http://ls457/_layouts/nintexworkflow/BiztalkHandler.ashx)
No workflows are waiting for a BizTalk message with message Id of 'GeneralAccessRequest_2010-08-23T15_00_04_44961212B370C554EDFAC41C1201ED6CEFB' on teamsite http://ls457/sites/testapp. No processing has been done.

What could that mean? Any ideas? I definitely changed nothing on the orchestration or BizTalk administration. The BizTalk action sends the data correctly to it's destination (database), but it seems that nintex doesn't receive any return data. I don't think it's a BizTalk problem, because in the BizTalk Message Tracking Database the Message is listet, so it has been sent correctly by BizTalk. But the handler probably has problems to find/receive this message.

Kind regards,


Viewmodel property not set to [Required] yet getting error message saying it is?


I have a viewmodel that i use for my view

public int SelectionId{ get; set; }        
public IEnumerable<Selections> Selections { get; set; }

Notice that SelectionId is not decorated with [Required]. In my view, i use DropDownFor like this:

<%= Html.DropDownListFor(m => m.SelectionId, new SelectList(Model.Selections, "Id", "Name"), "--- Select ---")%>

It should be possible to not select anything from the dropdown, resulting in model.SelectionId = 0, which is fine. Why do i get a "SelectionId field is required" error when i Post?  If i do this:

<%= Html.DropDownList(mySelectionId, new SelectList(Model.Selections, "Id", "Name"), "--- Select ---")%>

I no longer get the error if i dont select anything, which is what i want - but no way to bind it to the id if the user does select something

thanks for any help!

Bizarre Error. "Message: [Column Name]"


I'm getting a really strange error in my application when under heavy load.  The page(s) pull information from our SQL database and when this error occurs, I don't get a real error message.  Instead, the error information looks like the following:

Message: TimeZoneOffset
Source: System.Data
StackTrace: at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at System.Data.SqlClient.SqlDataReader.get_Item(String name)
at WebReport_mb_Main.GetTimeZoneDetails() in C:\Projects\WebReport\mb_Main.aspx.cs:line 260
at WebReport_mb_Main.Page_Load(Object sender, EventArgs e) in C:\Projects\WebReport\mb_Main.aspx.cs:line 38
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

So what does this mean?  More importantly, how can I fix it?  If no one knows the answer, does anyone have any ideas for what I can do to better search for thi

How can I solve this problem?::Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.Cryst


I upgraded my web application from visual studio 2003 to 2008. When I want to create a report in visual studio 2008 and receiving this error at runtime. I am able to compile but when runnning thats when I am getting this error.

How can I solve this problem? please help.

Compilation Error

Server Error in '/IRPSDEV' Application.

Compilation 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.

Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\10.5.3700.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\irpsdev\9e97e0a9\94a2ecd\assembly\dl3\151eb571\00df56e1_6064c201\CrystalDecisions.Web.DLL'

Source Error:

Line 161:        
Line 162:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 163:        private global::CrystalDecisions.Web.CrystalR

XML Task error message hexadecimal invalid character

I am developing a SSIS package to add data from an XML file to an existing SQL Server table.  I have completed several similar projects, but on this XML file I am getting the error from the Data Flow tab between the XML Task and Data Flow Task: Error: 0xC002F304 at XML Task, XML Task: An error occurred with the following error message: "'', hexadecimal value 0x15, is an invalid character. Line 28, position 54.". Error: 0xC002928F at XML Task, XML Task: Property "New Source" has no source Xml text; Xml Text is either invalid, null or empty string. Task failed: XML Task Warning: 0x80019002 at zSTU_TS_Element: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "zStu_TS_Element.dtsx" finished: Failure. Do you know how I can fix this? This is the line it is referring to: <z:row c0='12' c1='80' c2='2006-04-17' c3='539' c4='1M2083N4N5N6N75800901110 11 '/>
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend