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

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

Problem with Movie Database Application

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :ASP.Net
Hi Im following MVC tutorials on ASP.net website..I have a problem at Movies database application found in http://www.asp.net/mvc/tutorials/create-a-movie-database-application-in-15-minutes-with-asp-net-mvc-cs  Listing 3 - Views\Home\Index.aspx----------------------------------------------------------------------------------------------I dont understand where "Model" refer to in this code <% foreach (var item in Model) { %>  Also im confusing with accessing the database fields using var item Please explaine me what is happening in this code.<% foreach (var item in Model) { %> <tr> <td> <%= Html.ActionLink("Edit", "Edit", new { id=item.Id }) %> | <%= Html.ActionLink("Details", "Details", new { id=item.Id })%> Movie Database Application

View Complete Post

More Related Resource Links

problem rename sharepoint 2010 search service application admin database

Hi all, i have a problem that hopefully someone has an answer to.  i am not too familiar with sharepoint so please excuse my ignorance. we have sharepoint 2010 on a windows 2008r2 server.  everything seems to work fine.  but as you know, the default database names are horrendous.  i have managed to rename all of them, except for the "search service application" admin database. the default is: Search_Service_Application_DB_<guid> the other 2 databases (crawl and property) were renamed without a problem. we are following the article from technet on how to rename the search service admin db (http://technet.microsoft.com/en-nz/library/ff851878%28en-us%29.aspx).  it says to enter the following command: $searchapp | Set-SPEnterpriseSearchServiceApplication -DatabaseName "new database name" -DatabaseServer "dbserver" however, i get an error about identity being null.  no big deal, i add the -Identity switch and the name of my search service application.  but the real problem comes the error it throws:   Set-SPEnterpriseSearchServiceApplication : The requested database move was aborted as the associated search application is not paused. At line:1 char:54 + $searchapp | Set-SPEnterpriseSearchServiceApplication <<<<  -Identity "Search Service Application" -DatabaseName "ShareP

Problem connecting to new database in migration of existing application


I have an existing mobile application in use for several years

Previous server environment: SQL CE 3.0 / SQL Server 2005 / Windows Server 2003.  

New target server enviornment: SQL CE 3.5 SP2 (64bit) / SQL Server 2008 R2 / Windows 2008 x64

Connection is pass-through with IIS_IUSR credentials

Protocol is HTTPS

Diagnostic steps for troubleshooting connection to NEW environment:

Problem making Role based Menu in MVC application



 I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.

 I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net

 I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute

 but this coding does not count  those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx 

 In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and  some links are available rolewise.Now what is the solution for that?



problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Upsize Your Database: Convert Your Microsoft Access Application to Take Advantage of SQL Server 7.0


What if you need to convert an existing Microsoft Access 97 database application into a true client-server application that is based on a SQL Server back end? If you know a little about Visual Basic and SQL Server, it's easy to make your app take advantage of the power and scalability provided by SQL Server 7.0. Using some concrete code examples, this article takes you step by step through converting the native Jet queries in your Access application into stored procedures and pass-through queries that SQL Server can use. You'll also learn how to pass on parameters when your client-server app calls these SQL Server stored procedures and queries.

Michael McManus

MSDN Magazine June 2000

An example of packaging web application containing database upgrade SQL file

A few months ago, we have a blog talking about extending the web publishing pipeline to package database project deployed SQL file.  In this blog, I'll show step by step example of packaging web application with SQL Server database upgrade SQL file using Visual Studio 2010.  This way, we can generate a web package with incremental SQL script to certain database version.  The scenario may help distributions of a web upgrade package which needs to be installed on many different locations, each with their own SQL server database.   1. Create a Web Application Project 2. Add a new "SQL Server 2008 Database Project" to the solution 3. Prepare a development database, such as my test1 database as the following: 4. Right click our...(read more)

WSS 3.0 - problem with moving the database


My company wants to move a database included with WSS 3.0 installation to a *separate* server.
We want to have the database completely separated, on a different computer, on SQL Server 2005 installation.

Unfortunately, I'm not sure If the sharepoint is configured as a "Web Front End" or  "Stand-alone".
All I know, everything currently is on the same computer, and we can connect to the live database using the following path: \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

The question is, how can we move the database to SQL Server 2005, on very different server, leaving the application untouched?

Quick summary, we currently have:

--- Server A: (WSS 3.0) + [windows internal database / SSEE (not sure!)] + DOMAIN X

and we want t

How to fix error in MVC movie database tutorial from Asp.net?


I followed the tutorial at http://www.asp.net/mvc/videos/creating-a-movie-database-application-in-15-minutes-with-aspnet-mvc At 12:04 in the video, the author,  Stephen Walther. inclues the line

            return View(_entities.MovieSet.ToList());
When I tried to compile this I get an error: 
Error 1 'MovieApp.Controllers.MoviesDbEntities' does not contain a definition for 'MovieSet' and no extension method 'MovieSet' accepting a first argument of type 'MovieApp.Controllers.MoviesDbEntities' could be found (are you missing a using directive or an assembly reference?) P:\experiment\MovieApp\MovieApp\Controllers\HomeController.cs 18 35 MovieApp

If I just enter return View(_entities. then Intellisense  offers Equals, GetHashCode, GetType, and TosString.

Does this suggest that _entities is not being i

SQL 2005 Database Problem

When trying open up a report from a customer database.  I recieved the following error: Please contact technical support with the following information:   Error ID: ERHIG030000340 Error message: There was a problem with the SQL or table when trying to open the display The table name is "taOrderHistory" The SQL is: Underlying problem: Column 'taOrderHistory.OrderHistoryID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at RadWebNet.rwDataSupport.OpenData(String SQLIn, rwConnection ConnIn, OpenDSReturnType ReturnWhat, Int32 TimeOut, Object[] ParamsIn) in D:\Misc Projects\RadWeb\RadwebV4-7-1\rwData.v

Creating an database search application in VS C#

Hello everyone, I wish to create a C# application that will have a form and a text box where I can enter a text, and then ask the application to search if this text exists in a database. If it exists, I want all the information associated with this text to be displayed in a datagrid view or list box. I am able to create a database in SQL Server and I can connect to my database from VS 2005 C#. If this is possible, how do I go about it? Many thanks in advance.

Problem with precompiling web application for deployment

Hi,I'm developing a web application consisting of several DLLs. I have no problem whatsoever compiling en building the application from within Visual Studio 2008 itself. But when I try to precompile the application (for deployment) from the VS command prompt, I get compilation errors.One of the errors is: "Could not load file or assembly 'wsCore' or one of its dependecies. The system cannot find the file specified".How can it be that VS2008 is perfectly capable of compiling the application from within the IDE and that same application can't be compiled from the command prompt?What am I missing here?

Looking for Clarification - Using a SQL Database MDF in an ASP.Net Application

I am looking to understand how to use Database files with ASP.Net web application projects. Very similar questions were posted, but I couldn't find quite the clarification I am looking for, so here's another post. I've been programming with ASP.Net for a while, but have always been in an environment where I had a full SQL server setup, and the databases were not file format. For the purposes of this project I am trying to keep it in .MDF format so that I can pass it on easily to my customer and let them do what they wish with it. The project is in Visual Studio 2010, a simple ASP.Net 4.0 MVC2 application that is to use EF 4.0 for persistence. Background Issue First thing I did was add a database to App_Data folder. It shows up on Server Explorer and I can manually add tables via Visual Studio - this should mean that the connection string and permissions and such fine I would think. So, next step. I created an Entity Diagram, built everything "model first" and used the Model to generate the database schema. Using the connection string in web.config, the generated SQL code runs, and says at the bottom of VS, "Disconnected". I go to the Server Explorer, and sure enough there's a red X next to the DB file. I expand the MDF, the little black arrow comes back, showing me I am connected. I try to run it again... and it does the same... "Disconnected"

Database connection problem in ASP.NET

Hello,            I m having a database problem that I couldnt identify. The IIS loses connection to database once in 3 weeks.  Once  you restart the IIS everything is normal. Looks like IIS is fine because i can go to static pages. When I go to a page that requires database connection I get this error: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - Either the application has not called WSAStartup, or WSAStartup failed. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)   Is this a connection string problem?. because without changing anything if I restart the webserver all is fine.  Is this a problem with application state?   It cant be at the sql server side as other applications on the machine work fine. There is something going on with IIS not sure what it is.   Any help would be appreiciated.   Thanks, Bharani      

Basic data type problem with database insert

Hi,I'm trying to write some values into a database, but I think there's an issue with the data types.  Here's what I've got: public static string Hello(string pageId, string inOut) { string itemId = ""; string period = ""; var cookie = HttpContext.Current.Request.Cookies["visitorGUID"].Value; SqlConnection conn; SqlCommand comm; conn = new SqlConnection(GlobalSettings.DbDSN); comm = new SqlCommand("INSERT INTO myTable (memberGUID) VALUES (@memberGUID);", conn); comm.Parameters.Add("@memberGUID", System.Data.SqlDbType.Text); comm.Parameters["@memberGUID"].Value = cookie; try { conn.Open(); comm.ExecuteNonQuery(); return "Item added: cookie = " + cookie + " / pageId = " + pageId + " / inOut = " + inOut + " / pageId = " + pageId + " / itemId = " + itemId + " period = " + period; } catch { return "Item caught: cookie = " + cookie + " / pageId = " + pageId + " / inOut = " + inOut + " / pageId = " + pageId + " / itemId = " + itemId + " period = " + period; } finally { conn.Close(); } } At the moment I'm just trying to insert the value of the cookie into the database as a test.  It works fine when I

Security problem with cross database chaining and stored procedures

I have a situation whereby ProcA exists on database A, but ProcA executes about 20 stored procedures scattered across different databases. To further complicate matters some procs that ProcA calls also call other procs in other databases, this then presents the problem of cross database chaining where you can’t really write to a database from a proc that resides in another database. I am wondering how I can get around this problem, I know I can simply let open cross database chaining and the problem will go away, the other option is to create a proxy which is very complicated and wouldn’t work in my environment. Is there any way around the problem.

Questions on Multi-Tenant Data Architecture for SQL Server Database and ASP.NET application

My company wants me to make the same asp.net application and sql server database be sharable amongst different clients. Clients will use the database for their own business use, will have their own data, we will have our own data. How can I share the same SQL Server database amongst different clients having same ASP.NET application (but somehow be able to differentiate which client user is logging in) ? Do I need to use ApplicationID and how will I detect at login which one to use ? I know I will need to add another field in all tables to differentiate client's data from ours.  

is there any problem if i create a site collection through programmatically which web application ha

hi all, My web application have 2  types of authentication -- for internal users (windows authentication) and external users (Form based authentication). I am creating site collections through programmatically in the web application. so this site collection should have the permission as form based authentication for external users and windows authentication for internal users. is it possible are not? please give me some suggestions on creating site collections which have form based authentication and windows authentication. thanks in advance......
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