Click here to Skip to main content
15,890,438 members
Everything / Model

Model

model

Great Reads

by Ehsan.MA
Consider rigid body
by Mostafa Asaduzzaman
How to create a quick pie graph using MVC Model and CanvasJS
by Abhishek Kumar Goswami
This helps to make a visible date field in Chrome native datepicker while it will bind from the Model in ASP.NET MVC 4.
by coded007
A word about Unified Dimensional Model we use in analysis services.

Latest Articles

by Ujwal Watgule
Credit card fraud detection is an important application of machine learning techniques.
by Pete O'Hanlon
How to use arrays to manage multiple items
by Pete O'Hanlon
What is an array and how to use it to manage multiple items
by Uladzislau Baryshchyk
This series of articles consists of three articles, in which I will demonstrate step by step how to create a .NET core MVC project

All Articles

Sort by Title

Model 

31 Oct 2022 by Member 10252017
Model: public class ClientSetupDto { public byte Status { get; set; } = 0; public string ClientName { get; set; } public string ClientId { get; set; } } API Request: [HttpPost] ...
3 Oct 2016 by Saineshwar Bageri
In this article, we are going learn to create an application that works online and offline.
17 Feb 2022 by Pete O'Hanlon
What is an array and how to use it to manage multiple items
25 Feb 2023 by Pete O'Hanlon
How to use arrays to manage multiple items
14 Sep 2014 by Mihir_Naik
Description: When i post form with two count of puchaseordertax, i will found that but if i post with only one record (Count) it did'nt![Note:Uid is working s index and Correctly! ]My Model:class PurchaseOrder{int PurchaseOrderID {get;set;}datetime PurchaseOrderDate {get;set;}public...
31 May 2013 by Vitalij Dešuk
I have User, Prog, Enrollment model associated has_man through. Idea is that User adds Prog to profile and Prog can accept User's request or decline.
21 Jun 2020 by Leif Simon Goodwin
WPF docking window manager library
1 Oct 2015 by musti_276
Hi,The question I asked in the google forumhttps://groups.google.com/d/msg/angular/x-9erGOfVak/60FSrTxvAAAJ
17 Dec 2014 by Israel Thieme
I did a multilevel bind using index:
17 Dec 2014 by Maciej Los
I'd suggest to read this: Hierarchical Data Binding in ASP.NET[^]
22 Dec 2014 by Israel Thieme
I'm having trouble to bind a 2 level nested model. Here is what I've come up so far.Model:RequestSignature Model:public class RequestSignature{ public int Id { get; set; } public string name { get; set;} public virtual ICollection Pages { get; set; } ...
15 Dec 2017 by Jakub Provaznik
Hi I am working on my own application. I set the the basic crud and when I want to create new item in database through my create form, everything goes well. Problem is when I intentionally miss something and expecting error messages. Then I have an excetion: Quote: The ViewData item that has...
28 Mar 2013 by Florian Rappl
An introduction to async / await, popular mistakes and solutions for asynchronous programming, as well as usages and benefits from using asynchronous programming. We will also discuss interesting patterns based on concurrency.
27 Sep 2020 by YawerIqbal
A couple of questions answered about binding CDS data using Knockout and a few more tips shared
31 Jul 2012 by Samir Kunwar
Information retrieval using boolean retrieval model
28 Jul 2016 by Member 10212775
Dear Members, I am doing project in mvc. I have my forms in bootstrap model for saving and i need to show a message,if i typed anything on any input box and click on close."Data Not Saved. Are you Sure you want to leave the form with out saving the data" i need to show a confirmation...
19 Jan 2021 by rtksmithjoton123
TryValidateModel can only justify whether it is valided successfully, but it can not give the error message. How can do it. What I have tried: I test the TryValidateModel , and find some document, but no this method to realize getting the...
19 Jan 2021 by Sandeep Mewara
You need to use ValidationSummary to get details of the error. An example: Validate Model Programmatically in ASP.NET MVC | BinaryIntellect Knowledge Base[^] Read more here: ValidationSummary in ASP.NET MVC[^] ValidationSummary Class...
27 Dec 2011 by saivijayabhaskar
I have 10 clients, all are having same schema. Now i want to implement Ad-Hoc reporting based on these schema's. My problem here is i have to devolop 10 models for all 10 clients. Instead of creating 10 models is there any way to change the database name of connection string...
4 Apr 2013 by Rohith Reddy Vadiyala
Hi ,I'm using a JQuery Grid in MVC Application. I cannot assign or compare javascript value with model values the following is the code related to it.1. function (value) {2. var val=value;3. @foreach (var item in Model.ToList())4. {5. ...
5 Apr 2013 by Moykn
You are trying to run server-side code alongside client-side code this will not work/*this is client-side code*/ function (value) { var val=value;/*this is client-side code*//*this is server-side code - it will run when page is being rendered but will not exists in the client...
12 May 2016 by Deepak Kanswal Sharma
I'm New to MVC Application . My problem is while I'm trying to connect to Sql Server2008 . This is giving me the error :- Cannot open database "rsbenggmvc.Models.RsbEnggContext" requested by the login. The login failed.Login failed for user 'DEEPAK-PC\DEEPAK'.Project Name :-...
12 May 2016 by Dave Kreskowiak
There's really nothing to help with. It comes down to you reading up on SQL Server security and understanding how it works and how to set it up. There is no way you're going to have someone just give you a blurb in a forum post and it'll magically work.The error is pretty clear. The SQL...
24 Jul 2014 by brknlpr
hello everybody I am trying to get data when one of my dropdown selected index change here are my codes I couldn't get where am ı missing or doing something wrong I am very glad if you help me thank you .this is my script code$("#ddOrder").change(function (e) { alert =...
24 Jul 2014 by Yogesh Kumar Tyagi
view this article it may help youhttp://www.c-sharpcorner.com/UploadFile/3d39b4/casecading-dropdown-list-with-mvc-linq-to-sql-and-ajax/[^]
18 Feb 2014 by swetajmistry
When all tables for database were selected for database first approach for creating entity framework sample modules, certain tables were added other were not. also for one which are not visible in designer, entities were not created. Updating through DB also didnt worked. Any suggestion as to...
22 Aug 2019 by Member 14164795
How do I clear the bind on these properties so that changes I'm trying to make in an onpost method pull through? I have 6 bound properties in a ShipmentModel: [BindProperty(SupportsGet = true)] public ShipmentModel Shipment { get; set; } public class ShipmentModel { public string...
22 Aug 2019 by jimmson
You need to pass property name to ModelState.Remove method, not the value. Either pass the property name in string, eg. ModelState.Remove("CurrentShipDt1"); or in the newer .NET framework, you can use nameof() keyword, eg. ModelState.Remove(nameof(Shipment.CurrentShipDt1));
22 Aug 2019 by Member 14164795
This worked for me: Shipment.CurrentShipDt1 = null; Shipment.CurrentShipQty1 = 0; Shipment.CurrentShipDt2 = null; Shipment.CurrentShipQty2 = 0; Shipment.CurrentShipDt3 = null; Shipment.CurrentShipQty3 = 0; Shipment.CurrentShipDt4 = null; Shipment.CurrentShipQty4 = 0;...
19 Jul 2023 by FuFu Dev's
I have a two models (Current and Original) that have the same properties. I want to build in a validation to check if one of the properties (Address - which is a collection consisting of "Country, City, Suburb, Code") have the same values or they...
19 Jul 2023 by PIEBALDconsult
If you have access to the code for the Address class, you can add the ability for them to compare themselves. The following is a very naïve example. Comparing addresses is a very complex topic with many pitfalls. public partial class Address...
18 May 2017 by Khademul Basher
How to create a set of data models from a set of database tables.
3 Apr 2012 by Mikhail-T
Tutorial on how to create simple extension that converts view model propety name to string
29 Nov 2021 by Uladzislau Baryshchyk
This series of articles consists of three articles, in which I will demonstrate step by step how to create a .NET core MVC project
23 Apr 2017 by Khubaib Khawar
I have the problem statement to make an Object Model for. Problem Statement: Every vehicle has an engine and a gearbox. A gearbox is composed of pulleys working according to predefined gear ratios. Cars have smaller engines with 4-6 gears while Sports Utility Vehicles (SUVs) have bigger engines...
23 Apr 2017 by KarstenK
My first advice is that you read and watch some tutorials about UML to understand that stuff. Your will have to talk or write about your solution The second is, that you use some pencil and paper and draw these relations. Hints: - a car has one gear box - a gearbox consists of some gears...
6 Apr 2021 by Muhammad Din Khairul Izman
hello I am trying to create a website that saves the name and time when a person clocks in to a database, but the time that was stored is off by 8 hours. Here is the code: from django.db import models from datetime import datetime, date ...
15 Aug 2023 by Ujwal Watgule
Credit card fraud detection is an important application of machine learning techniques.
7 Aug 2016 by MohamedKamalPharm, Omneya Hassanain, Nouran Yasser, Fatma Abdelhameed
Simulation Model to plan the capacity of an oncology Hospital with limited number of beds. The R script is run on R Studio or called from PHP.
26 Jun 2014 by Bhanu Pratap Verma
Dear All,I want to display a popup message when user place the mouse on a date in the calender control.Popup is showing but is blinking very fast.Massage having hyperlink which redirect to other page.Please help me ASAP.Aspx Code:
27 Jul 2015 by Member 11866351
Hi ,I have to populate **distinct** company name in Dropdownlistfor from @model IEnumerableI tried the following way. Nothing is working. Your help is appreciated.1. @Html.DropDownListFor(Model.Select(i => i.CompanyName).Distinct().ToList(), new List(), new { @class...
27 Jul 2015 by Richard Deeming
Try something like this:@Html.DropDownListFor(model => model.CompanyName, new SelectList(Model.Select(i => i.CompanyName).Distinct()), new { @class = "input-large form-control" })
27 Jul 2015 by Member 11866351
I tried and got the following error:CS1061: 'System.Collections.Generic. CS1061: 'System.Collections.Generic.IEnumerable'does not contain a definition for 'CompanyName' and no extension method 'CompanyName' accepting a firstargument of type...
27 Jan 2017 by Francesco Bigi
Hello People, I have this issue:I want to put the marital status on drop down list, when I make the register of the new user, and chose married or unmarried, and click on the save button, on my db i see that it received the id (1, 2) instead of "married" or "unmarried".This is what I see...
26 Jan 2017 by F-ES Sitecore
That's how dropdowns work, there are two elements, the name and the value. The name is what appears in the list and the value is what is submitted with the form. Normally you'd convert the ID back to the relevant text when needed. However if you really do only want the text and you don't care...
27 Jan 2017 by Francesco Bigi
Many thanks to F-ES Sitecore for your help!Actually what I have done is this:// // POST: /Account/Register [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task Register(RegisterViewModel model) { ...
17 Mar 2015 by Member 10378039
Hi All,Im creating a windows application. i have used ADO.net Entity model for database connection. using Entity framework i have added values to database and using stored procedure i displayed database values in data grid view. Now i want to edit, Update, delete, data grid view rows by...
16 Mar 2015 by Peter Leow
Check this out: Insert,Update And Delete Datagridview using Entity Framework[^]
30 Oct 2015 by LeeMinhSGU
I'm have a database with 2 tables + Personal : ID (PK), Name, Code (FK), Birthdate+ Social : Code (PK), AddressI have added a ADO.NET Entity Data Model, in Model.Context.tt - SqlEntities (My Entities) there only 2 dbset is Personals and Socials so I only can choose a tablestring sql =...
30 Oct 2015 by Krunal Rohit
Use LINQ instead:using(var entity = new SqlEntities){ var personals = entity.Personals.ToList();}----------------------------------[Update]Do something like:string sql = "SELECT e.ID, e.Name FROM SqlEntities.Personals AS e"foreach (DbDataRecord rec innew...
5 Aug 2015 by PriteshK
//The purpose of this code is to take the attachment from an infopath form and add it to a Sharepoint 2013 library.//I have the code below but am receiving the error "namespace Sharepoint does not exist. Even though I have added it to the references.I believe it is because I am using...
5 Aug 2015 by Richard Deeming
Your project has the target framework set to .NET 2.0; the assembly you're trying to reference requires that you change it to at least .NET 3.0.How to: Target a Version of the .NET Framework[^]
19 Jan 2021 by YawerIqbal
How Fiddler for model driven apps works and getting started
26 Sep 2014 by Søren Gullach
Fuzzy lib that have a GUI and uses Lagrange for member curve generating
23 Jan 2014 by johnson10016
Hai everyone. I am new to this forum. Can anyone tell me the usage of web form model
23 Jan 2014 by Richard MacCutchan
Try https://www.google.com/search?q=web+form+model[^].
25 Oct 2011 by Sumeet.kate
Hello,I need Mathematical Model for....1. Grayscaling2. Thresholding 3. Canny Algorithm4. Surf Algorithm
25 Oct 2011 by Simon Bang Terkildsen
Google! I'll give you the first 2http://www.google.dk/search?gcx=w&sourceid=chrome&ie=UTF-8&q=grayscale+algorithm[^]http://www.google.dk/search?aq=f&gcx=w&sourceid=chrome&ie=UTF-8&q=Thresholding+algorithm[^]
29 Mar 2015 by Navneet k soni
Here i have a Code for a html hyper link page to redirect on a specific new page Controller Page Code public ActionResult our-services() { ViewBag.Message = "Your contact page."; ...
23 Dec 2014 by WaterFountain
The code for my android application is below and so far I'm happy with it. Before anyone comments, I do acknowledge it requires the addition of further validation. The android application is a login system which makes use of SQLite to store login information such as usernames and passwords for...
31 Jul 2020 by charal
The files .a3d are for modeling and I do not know how to create them. What I have tried: I found that an A3D file created in Maya and translated from a Collada file. Nothing else.
31 Jul 2020 by Sandeep Mewara
A3D is Alternativa Player 3D Export File - is created by AlternativaPlayer, an online 3D models viewer; contains a 3D model exported from the online program Refer: .A3D File Extension - How do I open it?[^]
12 Dec 2016 by Webber Chiang
I am not very familiar to SQLThe following infomration are from my special homework. I come here to ask some hints about SQL language***The integrity rules are as following:1.Each employee may be managed by one other employee2.Each employee may manage one or more other...
8 Apr 2021 by Robert Woodard
So I have a very complex stored procedure that returns a pivot table of data. This data is dynamic. Column names will change and the amount of columns can change. Based of the number of chart audits that were audited for a particular...
8 Apr 2021 by Richard Deeming
Even if you're using Entity Framework, you can still get access to the underlying connection to execute raw SQL commands. For example: var dt = new DataTable(); using (var command = context.Database.GetDbConnection().CreateCommand()) { ...
12 Aug 2020 by Bullgill Coder
Hi I am trying to get the address values from a simple post request to an API so I can read them an populate a SQL table. Items such as name etc I am able to read and write to the database, but each person has 2 addresses so these are in the json...
11 Aug 2020 by Garth J Lancaster
not sure what you mean by Quote: so these are in the JSON as an array (without square brackets). .. it's either proper JSON or not, else thump the person who owns the API and tell them to sharpen up !! (It's really hard to work with bastardised...
12 Aug 2020 by F-ES Sitecore
You treat properties in json that are other objects as properties in your c# classes that are classes that match the property's values. So in your case have an Address class that has the fields for the addresses and add a shipping_address and...
13 May 2020 by User 10985167
i have the folowing model public class Store{ public string StoreName {get; set;} public string Price {get;set;} public string PriceSeparator {get; set;} public string Currency {get;set;}}var storeModel = new Store();storeModel gets populated from a wpf window...
3 Mar 2016 by NextGenDeveloper
This issue was introduce back with .NET 4.5, and there still hasn't been a clear fix; However you can try to workaround this by putting special whitespace characters.For example, try;storeModel.PriceSeperator = "\u2007";Or alternatively, as suggested by placing some kind of keyword...
3 Mar 2016 by Alaa Ben Fatma
You could use "\t", I think, to give you a tab character. That might make the spacing more clear.storeModel.PriceSeparator = @"\t";
3 Mar 2016 by zcf-prince
Sorry,I don't know what's the significance for youI don't think the WCF will filter SpacesIf really as you sayeg:storeModel.PriceSeparator =storeModel.PriceSeparator .Replace(""," ");
13 May 2020 by talbot
I temporarily solved it in controller GET method this way: parameterName = Request.Query["parameterName"].FirstOrDefault() as string; if (parameterName == string.Empty) parameterName = null;
22 May 2015 by Duncan Edwards Jones
I am building a DSL using the Visual Studio modelling SDK and one of my model classes needs to have a domain property that I want to just be one of a selection of items from a drop-down list.(I can't override a Microsoft.VisualStudio.Modeling.ElementNameProvider class, as this property is...
27 May 2015 by Duncan Edwards Jones
It turns out that if you right-click the top level item in the DSL Explorer there is a menu "Add New Domain Enumeration" that fires a builder to help you build a new enumerated type that is known to the model and can therefore be used for domain properties.
12 Apr 2015 by Am Gayathri
How do i use two model in one view in MVC4? I want to use two different models in my form.One is for registration another for login. I want to use both models in my main view. I added one model that contains two other model for registration and login. but am unable to fetch the values in...
12 Apr 2015 by Abhinav S
This article discusses many approaches to do this - Multiple Models in a View in ASP.NET MVC 4 / MVC 5[^].Multiple Models in Single View in MVC[^] will also help you.
1 Feb 2015 by Member 11162686
I want to store the data into the sql server inplace of the edmx model's default local database please provide the proper solution.
17 Oct 2019 by Malikdanish
I have two views and both need to be strongly type my model class is having 8 columns in total and my first view needed all these ten fields so i put Required validator on all fields , but on another view i just need the first 4 fields and the rest i do not know , so now I am using the same...
17 Oct 2019 by F-ES Sitecore
Have a model that only implements the 4 fields needed for the second view, then create a model that inherits from that model and has the other fields for the first view. Then it is just a matter of passing the right model to the right view. class SmallView { // common four properties } ...
14 Apr 2016 by _ProgProg_
Dears,I want to do some weird job which is: adding attributes dynamically to my model class without adding these attributes directly on each property in the model class.the whole story is:I have an MVC project using Code first with domain driven design so i have the following:Core...
14 Apr 2016 by johannesnestler
Sounds impossible - at least I can't think about a way to do it...Anyway some thoughts:What do you mean you can't add a reference to your core dll? But you crate a "hardcoded" reference (better dependency) to it anyway when reflecting, don't you?Why don't you use any of the "Standard...
23 Oct 2013 by Nkumary
I have a MVC 4 application with razor engine. I want to add a search function to my view which show a list of teachers. The view is strongly typed view.My Models is : Teacher.csnamespace TestGrid.Models{ public class Teachers { private String _TeacherName; ...
10 Nov 2013 by Christian Graus
Throw all this out and use Entity Framework instead. That makes it even easier to write code to search your database.
4 Feb 2017 by nik varma
Hi Guys,How can i apply a filter on "IEnumerable"? "GetTaskAllocatedOnFilter" property list any value can be null basis on that i need a dataPlease help, also let know if you guys want any other information to proved me solution on thisWhat I have tried:public class...
4 Feb 2017 by Thomas Daniels
You can use the .Where extension method: Enumerable.Where(TSource) Method (IEnumerable(TSource), Func(TSource, Boolean)) (System.Linq)[^]:using System.Linq;// Example: IEnumerable old = new int[] { 0, 1, 2, 3 };IEnumerable _new = old.Where(x => x != 0);In the above...
1 Jul 2012 by mails4balaji
Hi,I am trying to assign a value to a model of specific index inside a list of models. However it assigns to all elements irrespective of index. tried even removeat and insert too, nothing seem to work. code snippet as below.BasketDetailsModel basketDetailsModel =...
26 Jun 2020 by Member 14779968
I am trying to validate if the APIs contains the same property and value of the model that its being compared to. I have a Validate method which where I am deserializing the response from the server. I also have the DTO which the model. Then...
26 Jun 2020 by #realJSOP
attemping to deserialize Jason to a model object will throw an exception if thedesrialization can’t be performed. Why can’t you just put a try/catch block around the deserialization code and let nature take its course?
12 Nov 2015 by Raj.rcr
Dear All,I am trying to bind the model data into html table in my mvc application and able to get the data in UI in fraction of seconds. But when the records are more than 25k, it takes 15-20 seconds to bind.Below is my code :cshtml : ...
27 Oct 2015 by F-ES Sitecore
Creating large tables is always going to be slow. If a user spent 3 seconds on each of your rows it would take 20 hours to process the whole table, so you are obviously generating a lot of meaningless data the user ignores. There is no fast way to do what you want to do, instead you should...
30 Oct 2015 by Member 11247784
i am create a bootstrap model popUp for Registration on this popUp i use a link for google map for update of user location. After successfully update location from google map how to redirect again popUp with Longitude and latitude.
30 Oct 2015 by Krunal Rohit
What I told you in comment, it is right here:Bootstrap Modal Dialog - Loading Content from MVC Partial View[^]ASP.NET MVC 5 List Editor with Bootstrap Modals[^]-KR
27 May 2013 by kranthi1988
HI All,Im working on MVC4,We are validating the fileds in MODEL class using data annotation 'ValidationAtrtribute'.Everything is working fine as functionally but while throwing messge to the user, popup meessage window having a Header like 'Message From Webpage' and first word of the...
10 Apr 2016 by Mort Sjostrom
New to System.Dynamic namespace.I am attempting to create a class that, when instantiated, generates its own properties via string[] passed to its constructor. I'm not interested in assigning values at this point, nor generating methods/events. Only trying to understand how to create...
10 Apr 2016 by Sergey Alexandrovich Kryukov
You are looking in wrong direction. All you described so far is reduced to the use of the class System.Dynamic.ExpandoObject. Consider this, for example:using System.Dynamic;//...dynamic myObject = new ExpandoObject();myObject.SomeProperty = "some string";myObject.SomeOtherProperty...
12 Jan 2016 by Member 10273293
i have some images and i wanted when user click any image a model popup open and display that image in that popup. but i don't know how to create model popup ?please tell me how to create model popup and use it with imagebutton ?
12 Jan 2016 by Passion4Code
Hello,Please follow the below link. You can use Bootstrap modal here to display the image inside the Modal Pop up.jquery - Bootstrap open image in modal - Stack Overflow[^]Bootstrap Popup modal image - center vertical example code[^]Hope these help.Thanks
12 Jan 2016 by Sergey Alexandrovich Kryukov
I think you mean "modal popup". Please see my recent article Modal Popup From Scratch[^].I tried to discuss several alternatives, including making of from scratch.—SA