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


Top 5 Contributors of the Month
satyapriyanayak
Ashutosh Jha
ASPEvil
Mahesh
Post New Web Links

must declare a body because it is not marked abstract, extern, or partial

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

 Hi

Trying to learn MVC, but i'm getting the following errors:

Error 1 'Website.Domain.Models.Weather.IWeatherRepository.GetWeatherCity(string)' must declare a body because it is not marked abstract, extern, or partial D:\MVC3_Website\Website.Domain\Models\Weather\IWeatherRepository.cs 10 37 Website.Domain

Error 2 'Website.Domain.Models.Weather.IWeatherRepository.GetWeatherForcast(string)' must declare a body because it is not marked abstract, extern, or partial D:\MVC3_Website\Website.Domain\Models\Weather\IWeatherRepository.cs 11 37 Website.Domain

 

My code is below:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Website.Domain.Models.Weather
{
    public class IWeatherRepository
    {
        IEnumerable<WeatherForcast> GetWeatherCity(string strWeatherSearch);
        IEnumerable<WeatherForcast> GetWeatherForcast(string strWeatherID);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Website.Domain.Models.Weather
{
    public class WeatherForcast
    {
        public string loc { get; set; }
        public string loc_id { get; set; }
    }
}

using System;
using System.Collections.Generic;
using Syst


View Complete Post


More Related Resource Links

must declare a body because it is not marked abstract or extern

  

When I write the code below I'm getting the error: "must declare a body because it is not marked abstract or extern" for get and set accesors. What am I doing wrong?

Thanks a lot

 

using System;

namespace Dados

{

public class Manutencao : IDados

{

public Manutencao()

{ }

public string Nome { get; set;}

public string Idade { get; set;}

}

}

<

Abstract Factory Design in C# , Vb.NET

  
Provide an interface for creating families of related or dependent objects without specifying their concrete classes

Abstract Factory Design Pattern (Sample in C# and VB .NET)

  
An abstract factory provides an interface for creating families of related objects without specifying their concrete classes. Sometimes one wants to construct an instance of one of a suite of classes, deciding between the classes at the time of instantiation. In order to avoid duplicating the decision making everywhere an instance is created, we need a mechanism for creating instances of related classes without necessarily knowing which will be instantiated.

Abstract Factory Pattern-Creational Patterns

  
The Factory pattern allowed us to decouple our client from an object which it uses. The Abstract Factory pattern extends this idea to manage separate families of objects.

A runtime selection, or configuration option, in our client could decide which family of objects is to be used. The Abstract Factory pattern allows us to write generic code to instantiate and use the family objects regardless of which family is chosen at runtime. The pattern also helps us enforce a rule where objects from just the chosen family are used uniformly by the client.

DECLARE CURSOR in Transact-SQL

  
Defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query used to build the result set on which the cursor operates. DECLARE CURSOR accepts both a syntax based on the ISO standard and a syntax using a set of Transact-SQL extensions.

InterFaces and Abstract Classes

  
Link Describes About Abstraction and Interfaces In Breif

MSDN Abstract Classes Link

  
MSDN Reference For Abstract Clases

abstract away the source of the connection string using a class with a static property.

  
ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Encapsulation
Let's abstract away the source of the connection string using a class with a static property.

partial view, 2 controllers

  

 Hi,

This is my first visit to the forums, I hope someone here can help me

 

I'm writing a small webapplication for creating repair tickets and adding comments, really basic

now I'm writing this in MVC2

So I have 2 controllers, 1 HomeController that does everything related to the tickets (listing tickets, creating new ones, editing) and 1 controller for the comments

the edit view for the homecontroller contains a partial view for /comment/create

so /home/edit/ticketnumber can edit the title and status of the ticket on the left side of the screen, the right side of the screen contains the partial view for adding comments

this is done like this:

Html.Renderaction("Create", "Comment");


but if I look at the generated html code when running the app, both save buttons go to /home/edit/ticketnumber

so the comment is never saved.

 

I hope this makes sense and that someone can help me solve this


Singleton Pattern and Abstract Class

  

I know what Singleton Pattern means and Abstract class means.

What I wanted to know was how would this apply to real world.

Could anyone give me any good example or simple explanation.

Say I have a simple website, why would I use any of the above if any.

Why would it simplify my architechture.

Thanks in advace. 


statement cannot appear outside of a method body

  

hi all,

  i am posting my vb.net problem .plz tell me how to resolve this :-


Dim conn As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString
    'Dim mysqlconnection As New SqlConnection(conn)
    'If mysqlconnection.State=ConnectionState.closed Then mysqlconnection.Open();
    'Dim mySqlcommand As New SqlCommand("select CategoryId,CategoryName from Categories", mysqlconnection)
    'Dim mySqlDataAdapter As New SqlDataAdapter(mySqlcommand)
    'Dim mydataSet As New DataSet()
    'mySqlDataAdapter.Fill(mydataSet);

    'Gridview1.DataSource=ds;
    'Gridview1.DataBind();
    'if mysqlconnection.State=ConnectionState.closed Then mysqlconnection.Open();

i m getting 5 errors in this code

declaration expected in mySqlDataAdapter.Fill method; Gridview1.DataSource=ds; Gridview1.DataBind();


Test Run: Partial Anitrandom String Testing

  

This column presents an approach to Antirandom (AR) testing the author calls partial AR string testing, which can be used to test a wide range of software systems.

James McCaffrey

MSDN Magazine October 2009


Cutting Edge: Programming AJAX with ASP.NET Partial Rendering

  

Dino Esposito compares the use of AJAX patterns and DOM manipulations to the use of the ASP.NET partial rendering engine.

Dino Esposito

MSDN Magazine August 2008


C#: Create Elegant Code With Anonymous Methods, Iterators, And Partial Classes

  

In this article Juval Lowy describes how exciting new features in Visual Studio 2005, that will improve your overall productivity compared to the first version of C#, so you can write cleaner code faster.

Juval Lowy

MSDN Magazine Visual Studio 2005 Guided Tour 2006


Categories: 
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