This question is locked. New answers and comments are not allowed.
I am using ASP.Net MVC3 using CSharp. Table names are SMS_User and SMS_Division in SQL Server 2008.
-When i create new user i want to show division id from sms_division table.
Table information:
SMS_User = UserName, DivisionID, EmailAddress
SMS_Division = DivisionID, DivisionName
Below is code for SMS_User Create View()
@Html.DropDownListFor(model => sms_user.divisionid, (IEnumerable<SelectListItem>) ViewData["ZamZam"], "<--Select a divison-->")
User Controller:
Controller Code:
private NetPerfMonEntities2 db = new NetPerfMonEntities2();
IEnumerable<SelectListItem>ZamZam= db.SMS_Division.Select(c => new SelectListItem
{ Value = c.divisionid.ToString(), Text = c.divisionid.ToString() } );
Error Message:
CS0103: The name 'sms_amountlimit2' does not exist in the current context