Search Results

Search found 1810 results on 73 pages for 'typed'.

Page 1/73 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Learning to implement dynamically typed language compiler

    - by TriArc
    I'm interested in learning how to create a compiler for a dynamically typed language. Most compiler books, college courses and articles/tutorials I've come across are specifically for statically typed languages. I've thought of a few ways to do it, but I'd like to know how it's usually done. I know type inferencing is a pretty common strategy, but what about others? Where can I find out more about how to create a dynamically typed language? Edit 1: I meant dynamically typed. Sorry about the confusion. I've written toy compilers for statically typed languages and written some interpreters for dynamically typed languages. Now, I'm interested in learning more about creating compilers for a dynamically typed language. I'm specifically experimenting with LLVM and since I need to specify the type of every method and argument, I'm thinking of ways to implement a dynamically typed language on something like LLVM.

    Read the article

  • Are there any strongly typed scripting languages?

    - by George Edison
    I am wondering if there are any strongly typed scripting languages. Python, JavaScript, etc. are great languages, but they are (to a certain degree) loosely typed. I am just wondering if anyone knows of any strongly typed scripting languages. And by scripting, I mean a language whose interpreter can be embedded in a C++ application.

    Read the article

  • SqlDateTime overflow thrown by Typed DataSet Insert

    - by end-user
    I'm using a Typed DataSet with an Insert statement; I have a table that has a smalldatetime field defined to accept null values. When I insert from a .NET 2.0 FormView, I get a "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM." Now, I've read this post, and the parameter as sent to the class constructor is defined as global::System.Nullable<global::System.DateTime> DoB So, it looks like it should accept a Nullable obj. Additionally, the generated code is testing the value sent. if ((DoB.HasValue == true)) { command.Parameters[6].Value = ((System.DateTime)(DoB.Value)); } else { command.Parameters[6].Value = global::System.DBNull.Value; } Specifically, the error is occurring when generated SqlClient.SqlCommand.ExecuteScalar() runs: try { returnValue = command.ExecuteScalar(); } So, I guess my question is: how do I use a Typed DataSet to set a blank value (passed from a FormView on CommandName=Insert) to a null in a database?

    Read the article

  • MS SQL and .NET Typed Dataset AllowDBNull Metadata

    - by Christian Pena
    Good afternoon, I am generating a typed dataset from a stored procedure. The stored procedure may contain something like: select t1.colA, t2.colA AS t2colA from t1 inner join t2 on t1.key = t2.key When I generate the typed dataset, the dataset knows whether t1.colA allows NULLs, but it always puts FALSE in AllowDBNull for t2.colA even if t2.colA allows NULL. Is this because the column is aliased? Is there any way, from SQL, to hint to VS that the column allows NULL? We currently have to go in and update the column's AllowDBNull if we regenerate the table. Thanks in advance. Christian

    Read the article

  • Delphi Typed Constants in Case Statements

    - by Andreas Rejbrand
    What is the most elegant (or least ugly) way of using typed constants in a case statement in Delphi? That is, assume for this question that you need to declare a typed constant as in const MY_CONST: cardinal = $12345678; ... Then the Delphi compiler will not accept case MyExpression of MY_CONST: { Do Something }; ... end; but you need to write case MyExpression of $12345678: { Do Something }; ... end; which is error-prone, hard to update, and not elegant. Is there any trick you can employ to make the compiler insert the value of the constant (preferably by checking the value of the constant under const in the source code, but maybe by looking-up the value at runtime)? We assume here that you will not alter the value of the "constant" at runtime.

    Read the article

  • Dynamic Connection Strings for Strongly Typed DataSet in a Class Library using App.Config

    - by Luc
    This is my first question on StackOverflow.com and I'm not sure if this is the correct way to do this. I found a similar question titled: Modifying the Data Source for the Strongly Typed Dataset Connection String. However, the answer provided is not working for me. I'm not able to comment on it because I don't have enough "reputation points" (again, I just signed up), and I didn't want to provide an "answer", because I don't know the correct answer. My problem is that I need to be able to modify the connection string inside the generated myproject.dll.config file, but doing so has no effect for me at all. My library still uses the default connection string that was setup at design time. I've tried everything I know to try, but still no luck. I've tried working around the issue using multiple different approaches, but still the problem persists. I can't find any help on the internet with my specific problem either. It would be great if somebody could shed some light as to why my modified config file isn't being read. Useful information: I'm using a Strongly Typed DataSet I don't know the actual connection string at design time. The app.config doesn't allow me to specify a 'User' scoped connection string. I'm tied to a class library (no Windows Forms) Thank you for any help! Luc

    Read the article

  • Looking for a fast, compact, streamable, multi-language, strongly typed serialization format

    - by sanity
    I'm currently using JSON (compressed via gzip) in my Java project, in which I need to store a large number of objects (hundreds of millions) on disk. I have one JSON object per line, and disallow linebreaks within the JSON object. This way I can stream the data off disk line-by-line without having to read the entire file at once. It turns out that parsing the JSON code (using http://www.json.org/java/) is a bigger overhead than either pulling the raw data off disk, or decompressing it (which I do on the fly). Ideally what I'd like is a strongly-typed serialization format, where I can specify "this object field is a list of strings" (for example), and because the system knows what to expect, it can deserialize it quickly. I can also specify the format just by giving someone else its "type". It would also need to be cross-platform. I use Java, but work with people using PHP, Python, and other languages. So, to recap, it should be: Strongly typed Streamable (ie. read a file bit by bit without having to load it all into RAM at once) Cross platform (including Java and PHP) Fast Free (as in speech) Any pointers?

    Read the article

  • Selecting one row when working with typed datasets.

    - by Wodzu
    I have a typed dataset in my project. I would like to populate a datatable with only one row instead of all rows. The selected row must be based on the primary key column. I know I could modify the designer code to achive this functionality however if I change the code in the designer I risk that this code will be deleted when I update my datased via designer in the future. So I wanted to alter the SelectCommand not in the designer but just before firing up MyTypedTableAdapter.Fill method. The strange thing is that the designer does not create a SelectCommand! It creates all other commands but not this one. If it would create SelectCommand I could alter it in this way: this.operatorzyTableAdapter.Adapter.SelectCommand.CommandText += " WHERE MyColumn = 1"; It is far from perfection but atleast I would not have to modify the designer's work. unfortunately as I said earlier the SelectCommand is not created. Instead designer creates something like this: [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitCommandCollection() { this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT Ope_OpeID, Ope_Kod, Ope_Haslo, Ope_Imie, Ope_Nazwisko FROM dbo.Operatorzy"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; } It doesn't make sense in my opinion. Why to create UpdateCommand, InsertCommand and DeleteCommand but do not create SelectCommand? I could bear with this but this._commandCollection is private so I cannot acces it outside of the class code. I don't know how to get into this collection without changing the designer's code. The idea which I have is to expose the collection via partial class definition. However I want to introduce many typed datasets and I really don't want to create partial class definition for each of them. Please note that I am using .NET 3.5. I've found this article about accessing private properties but it concerns .NET 4.0 Thanks for your time.

    Read the article

  • Question about how to use strong typed dataset in N-tier application for .NET

    - by sb
    Hello All, I need some expert advice on strong typed data sets in ADO.NET that are generated by the Visual Studio. Here are the details. Thank you in advance. I want to write a N-tier application where Presentation layer is in C#/windows forms, Business Layer is a Web service and Data Access Layer is SQL db. So, I used Visual Studio 2005 for this and created 3 projects in a solution. project 1 is the Data access layer. In this I have used visual studio data set generator to create a strong typed data set and table adapter (to test I created this on the customers table in northwind). The data set is called NorthWindDataSet and the table inside is CustomersTable. project 2 has the web service which exposes only 1 method which is GetCustomersDataSet. This uses the project1 library's table adapter to fill the data set and return it to the caller. To be able to use the NorthWindDataSet and table adapter, I added a reference to the project 1. project 3 is a win forms app and this uses the web service as a reference and calls that service to get the data set. In the process of building this application, in the PL, I added a reference to the DataSet generated above in the project 1 and in form's load I call the web service and assign the received DataSet from the web service to this dataset. But I get the error: "Cannot implicitly convert type 'PL.WebServiceLayerReference.NorthwindDataSet' to 'BL.NorthwindDataSet' e:\My Documents\Visual Studio 2008\Projects\DataSetWebServiceExample\PL\Form1.cs". Both the data sets are same but because I added references from different locations, I am getting the above error I think. So, what I did was I added a reference to project 1 (which defines the data set) to project 3 (the UI) and used the web service to get the DataSet and assing to the right type, now when the project 3 (which has the web form) runs, I get the below runtime exception. "System.InvalidOperationException: There is an error in XML document (1, 5058). --- System.Xml.Schema.XmlSchemaException: Multiple definition of element 'http://tempuri.org/NorthwindDataSet.xsd:Customers' causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence." I think this might be because of some cross referenceing errors. My question is, is there a way to use the visual studio generated DataSets in such a way that I can use the same DataSet in all layers (for reuse) but separate the Table Adapter logic to the Data Access Layer so that the front end is abstracted from all this by the web service? If I have hand write the code I loose the goodness the data set generator gives and also if there are columns added later I need to add it by hand etc so I want to use the visual studio wizard as much as possible. thanks for any help on this. sb

    Read the article

  • ASP.NET MVC Strongly Typed Partial View, gives could not load type error

    - by Matt
    I am attempting to create a strongly typed view with a "MVC View User Control" that is being rendered using Html.RenderPartial(). The top of my ascx file looks like this: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.Collections.IEnumerable<string>>" %> There is nothing else on this page, currently. When I execute the app and load the page that renders this control, I get the following error: Could not load type 'System.Web.Mvc.ViewUserControl<System.Collections.IEnumerable<string>>'. So, then I simplified it: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<String>" %> And then, just in case it needed to be fully qualified: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.String>" %> Everytime I get the same error (substituting type). what am I doing wrong here? I'm on .NET 3.5 with ASP.NET MVC 1.0 RTM.

    Read the article

  • How to create a typed stack using Objective-C

    - by Xetius
    I can create a stack class quite easily, using push and pop accessor methods to an NSArray, however. I can make this generic to take any NSObject derived class, however, I want to store only a specific class in this stack. Ideally I want to create something similar to Java's typed lists (List or List) so that I can only store that type in the stack. I can create a different class for each (ProjectStack or ItemStack), but this will lead to a more complicated file structure. Is there a way to do this to restrict the type of class I can add to a container to a specific, configurable type?

    Read the article

  • Inserting Rows in Relationship using a Strongly Typed DataSet

    - by Manuel Faux
    I'm using ADO.NET with a strongly typed dataset in C# (.NET 3.5). I want to insert a new row to two tables which are related in an 1:n relation. The table Attachments holds the primary key part of the relation and the table LicenseAttachments holds the foreign key part. AttachmentsDataSet.InvoiceRow invoice; // Set to a valid row, also referenced in InvoiceAttachments AttachmentsDataSet.AttachmentsRow attachment; attachment = attachmentsDataSet.Attachments.AddAttachmentsRow("Name", "Description"); attachmentsDataSet.InvoiceAttachments.AddInvoiceAttachmentsRow(invoice, attachment); Of course when I first update the InvoicesAttachments table, I'll get a foreign key violation from the SQL server, so I tried updating the Attachments table first, which will create the rows, but will remove the attachment association in the InvoiceAttachments table. Why? How do I solve this problem?

    Read the article

  • strongly typed dataset Insert record with C# problem

    - by Eyla
    Greetings, I'm using strongly typed data-set in windows application and I'm creating table adapter object to call insert function. The problem that there is nothing inserted to the table after calling the function and no error produced. here is my code: public PacketsDBDataSet1TableAdapters.packetsTableAdapter ds = new PacketsDBDataSet1TableAdapters.packetsTableAdapter(); private void btnSavePacketsInFile_Click(object sender, EventArgs e) { byte[] w = null; ds.InsertPackets("s", "s", "s", "s", "s", w); } I'm using same same code with ASP.Net but it is working OK. any advice??

    Read the article

  • how create a sql database fom a stongly typed dataset

    - by Keith Vinson
    I'm looking for an easy way to transfer a database schema I have developed inside visual studio as a strongly typed dataset (xsd file) into a corresponding sql server database. Silly me I assumed the process would be forthright, but I can't find out how to do it. I assume I could duplicate the tables column by column, but that seems so error prone. Does anyone know of a way to perform the schema transfer like this? Maybe a tool to translate the xsd file into a corresponding sql server ddl file? Final thought once I have the schema transferred moving data around between the two data stores will be straight forward, its just getting the schemas synced that has me stumped... Thanks, Keith

    Read the article

  • typed-dataset initializer problem with C# windows app.

    - by Eyla
    Greetings, I'm working in windows application using C#. I have typed-dataset called packetsDBDataSet and it has table adapter called packetsTableAdapter with method to insert data called InsertPackets(). when I want to insert new data I used a code that I used before with asp.net page and it was working ok but not I'm getting error. here is the code: public packetsDBDataSetTableAdapters.packetsTableAdapter ds = new packetsDBDataSetTableAdapters.packetsTableAdapter(); public packetsDBDataSet.packetsDataTable insert = ds.InsertPackets(); and here is the error: Error 1 A field initializer cannot reference the non-static field, method, or property 'Packets.Form1.ds' C:\Users\Ali\Documents\Visual Studio 2008\Projects\Packets-3\Packets\Packets\Form1.cs 26 59 Packets I already included to my project: using Packets; using Packets.packetsDBDataSetTableAdapters; please advice to solve this problem. Update : I also tried : public packetsDBDataSetTableAdapters.packetsTableAdapter ds = new packetsDBDataSetTableAdapters.packetsTableAdapter(); ds.InsertPackets("1","2","3"); and I'm getting this error: Error 1 Invalid token '(' in class, struct, or interface member declaration C:\Users\Ali\Documents\Visual Studio 2008\Projects\Packets-3\Packets\Packets\Form1.cs 28 29 Packets

    Read the article

  • Flex - Typed ArrayCollection as Horizontallist's dataprovider

    - by BS_C3
    Hi community! I have an ArrayCollection of objects. I'm passing this array to a horizontallist as a dataprovider and I'm using a custom itemRenderer. When executing the application, the horizontallist is displaying [object CustomClass][object CustomClass][object CustomClass][object CustomClass] I've tried casting each object in the itemrenderer as following: <mx:Label text="{(data as CustomClass).label1}"/> But it's not working... Thanks for any help you can provide. Regards, BS_C3 Edit - 09 March 2010 Let's go for some more code =) <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Component id="Item"> <mx:VBox width="180"> <mx:HBox width="100%"> <mx:Spacer width="100%"/> <mx:Button label="x"/> </mx:HBox> <mx:Image id="thumbnail"/> <mx:Label width="100%" horizontalCenter="0" text="Collection"/> <mx:HBox width="100%"> <mx:Label width="100" text="GIA"/> <mx:Label text="{data.charg_st}"/> </mx:HBox> <mx:HBox width="100%"> <mx:Label width="100" text="Finger Size"/> <mx:Label text="xxxxxx"/> </mx:HBox> <mx:HBox width="100%"> <mx:Label width="100" text="Carat"/> <mx:Label text="{data.carats}"/> </mx:HBox> <mx:HBox width="100%"> <mx:Label width="100" text="Color"/> <mx:Label text="{data.color}"/> </mx:HBox> <mx:HBox width="100%"> <mx:Label width="100" text="Clarity"/> <mx:Label text="{data.clarity}"/> </mx:HBox> <mx:HBox width="100%"> <mx:Label width="100" text="Shop"/> <mx:Label text="{data.lgort_fp}"/> </mx:HBox> <mx:HBox width="100%"> <mx:Label width="100" text="Resizing"/> <mx:Label text="{data.resizing}"/> </mx:HBox> <mx:HBox width="100%"> <mx:Label width="100" text="Price Excl. VAT"/> <mx:Label text="{data.net_price_fp}"/> </mx:HBox> </mx:VBox> </mx:Component> <mx:HorizontalList dataProvider="{GlobalData.instance.tray}" columnCount="4" rowCount="1" horizontalScrollPolicy="off" itemRenderer="{Item}" /> </mx:Canvas> FYI, the horizonalList dataprovider is an ArrayCollection of objects. Now, the horizontallist is displaying empty items... with the correct width... The arraycollection is not empty (I'm using an alert on the click event on an item, and I do retrieve the expected data). Hope this will help _< Regards, BS_C3

    Read the article

  • linq groupby in strongly typed MVC View

    - by jason
    How do i get an IGrouping result to map to the view? I have this query: var groupedManuals = manuals.GroupBy(c => c.Series); return View(groupedManuals); What is the proper mapping for the ViewPage declaration? Inherits="System.Web.Mvc.ViewPage<IEnumerable<ProductManual>>"

    Read the article

  • What are the key aspects of a strongly typed language?

    - by Chris Sutton
    What makes a language strongly typed? I'm looking for the most important aspects of a strongly typed language. Yesterday I asked if PowerShell was strongly typed, but no one could agree on the definition of "strongly-typed", so I'm looking to clarify the definition. Feel free to link to wikipedia or other sources, but don't just cut and paste for your answer.

    Read the article

  • Unit testing statically typed functional code

    - by back2dos
    I wanted to ask you people, in which cases it makes sense to unit test statically typed functional code, as written in haskell, scala, ocaml, nemerle, f# or haXe (the last is what I am really interested in, but I wanted to tap into the knowledge of the bigger communities). I ask this because from my understanding: One aspect of unit tests is to have the specs in runnable form. However when employing a declarative style, that directly maps the formalized specs to language semantics, is it even actually possible to express the specs in runnable form in a separate way, that adds value? The more obvious aspect of unit tests is to track down errors that cannot be revealed through static analysis. Given that type safe functional code is a good tool to code extremely close to what your static analyzer understands. However a simple mistake like using x instead of y (both being coordinates) in your code cannot be covered. However such a mistake could also arise while writing the test code, so I am not sure whether its worth the effort. Unit tests do introduce redundancy, which means that when requirements change, the code implementing them and the tests covering this code must both be changed. This overhead of course is about constant, so one could argue, that it doesn't really matter. In fact, in languages like Ruby it really doesn't compared to the benefits, but given how statically typed functional programming covers a lot of the ground unit tests are intended for, it feels like it's a constant overhead one can simply reduce without penalty. From this I'd deduce that unit tests are somewhat obsolete in this programming style. Of course such a claim can only lead to religious wars, so let me boil this down to a simple question: When you use such a programming style, to which extents do you use unit tests and why (what quality is it you hope to gain for your code)? Or the other way round: do you have criteria by which you can qualify a unit of statically typed functional code as covered by the static analyzer and hence needs no unit test coverage?

    Read the article

  • ASP.NET MVC 3 Hosting :: MVC 2 Strongly Typed HTML Helper and Enhanced Validation Sample

    - by mbridge
    In lue of the off the official release of ASP.NET MVC 2 RTM, I decided I would put together a quick sample of the enhanced HTML.Helpers and validation controls. I am going to use my sample event site where I will have a form so a user can search for information about a certain events. So when the Search page loads the Search action is fired return my strongly typed model. to the view.    1: [HttpGet]    2: public ViewResult Search(): public ViewResult Search()    3: {    4:     IList<EventsModel> result = _eventsService.GetEventList();    5:     var viewModel = new EventSearchModel    6:                         {    7:                             EventList = new SelectList(result, "EventCode","EventName","Select Event")    8:                         };    9:     return View(viewModel);  10: } Nothing special here, although I did want to show how to load up a strongly typed drop down list because that hung me up for a little bit. So to that, I am going to pass back a SelectList to the view and my HTML helper should no how to load this. So lets take a look at the mark up for the view.    1: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"    2: Inherits="System.Web.Mvc.ViewPage<EventsSample.Models.EventSearchModel>" %>    3:     4: <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">    5:     Search    6: </asp:Content>    7:     8: <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">    9:   10:     <h2>Search for Events</h2>  11:   12:     <% using (Html.BeginForm("Search","Events")) {%>  13:         <%= Html.ValidationSummary(true) %>  14:          15:         <fieldset>  16:             <legend>Fields</legend>  17:              18:             <div class="editor-label">  19:                 <%= Html.LabelFor(model => model.EventNumber) %>  20:             </div>  21:             <div class="editor-field">  22:                 <%= Html.TextBoxFor(model => model.EventNumber) %>  23:                 <%= Html.ValidationMessageFor(model => model.EventNumber) %>  24:             </div>  25:              26:             <div class="editor-label">  27:                 <%= Html.LabelFor(model => model.GuestLastName) %>  28:             </div>  29:             <div class="editor-field">  30:                 <%= Html.TextBoxFor(model => model.GuestLastName) %>  31:                 <%= Html.ValidationMessageFor(model => model.GuestLastName) %>  32:             </div>  33:              34:             <div class="editor-label">  35:                 <%= Html.LabelFor(model => model.EventName) %>  36:             </div>  37:             <div class="editor-field">  38:                 <%= Html.DropDownListFor(model => model.EventName, Model.EventList,"Select Event") %>  39:                 <%= Html.ValidationMessageFor(model => model.EventName) %>  40:             </div>  41:              42:             <p>  43:                 <input type="submit" value="Save" />  44:             </p>  45:         </fieldset>  46:   47:     <% } %>  48:   49:     <div>  50:         <%= Html.ActionLink("Back to List", "Index") %>  51:     </div>  52:   53: </asp:Content> A nice feature is the scaffolding that MVC has to generate code. I simply right clicked inside my Search() action, inside the EventsController and selected “Add View” and then I selected my strongly typed object that I wanted to pass to the view and also selected that I wanted the content type be “Edit”. With that the aspx page was completely generated, although I did have to go back in and change the textbox for the Event Names to a drop down list of the names to select from. The new feature with MVC 2 are the strongly typed HTML helpers. So now, my textboxes, drop down list, and validation helpers are all strongly typed to my model.  This features gives you the benefits of intellisense and also makes it easier to debug. “The Gu” has a great post about the feature in case you want more details. The DropDownListFor function to generate the drop down list was a little tricky for me. You first need to use a Lanbda expression to pass in the property you want the selected value assigned to in your model, and then you need to pass in the list directly from the model. Validations To validate the form, you can use the strongly type validation HTML helpers which will inspect your model and return errors if the validation fails. The definitions of these rules are set directly on the Model itself so lets take a look.    1: using System.ComponentModel.DataAnnotations;    2: using System.Web.Mvc;    3:     4: namespace EventsSample.Models    5: {    6:     public class EventSearchModel    7:     {    8:         [Required(ErrorMessage = "Please enter the event number.")]    9:         [RegularExpression(@"\w{6}",  10:             ErrorMessage = "The Event Number must be 6 letters and/or numbers.")]  11:         public string EventNumber { get; set; }  12:   13:         [Required(ErrorMessage = "Please enter the guest's last name.")]  14:         [RegularExpression(@"^[A-Za-zÀ-ÖØ-öø-ÿ1-9 '\-\.]{1,22}$",  15:             ErrorMessage = "The gueest's last name must 1 to 20 characters.")]  16:         public string GuestLastName { get; set; }  17:   18:         public string EventName { get; set; }  19:         public SelectList EventList { get; set; }  20:     }  21: } Pretty cool! Okay, the only thing left to do is perform the validation in the POST action.    1: [HttpPost]    2: public ViewResult Search(EventSearchModel eventSearchModel)    3: {    4:     if (ModelState.IsValid) return View("SearchResults");    5:     else    6:     {    7:          IList<EventsModel> result = _eventsService.GetEventList();    8:         eventSearchModel.EventList = new SelectList(result, "EVentCode","EventName");   9:   10:         return View(eventSearchModel);  11:     }  12: }  13:     } If the form entries are valid, here I am simply displaying the SearchResult, but in a real world sample I would also go out get the results first. You get the idea though. In my case, when the form is not valid, I also had to reload my SelectList with the event names before I loaded the page again. Remember this is MVC, no _VieState here :) So that’s it. Now my form is validating the data and when it fails it looks like this.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >