Click here to Skip to main content
15,892,809 members

last entity (page_count) in the above class is not from table. And in the select query I select all the columns from table and one column (page_count) is derived and calculated into the query ....

Member 9731119 asked:

Open original thread
[Table(Name = "dbo.tblProjects")]
public class ProjectsDto
{
private int _prjId;
[Column(Storage = "_prjId", IsPrimaryKey = true, IsDbGenerated = true)]
public int prjId
{
get { return _prjId; }
set { _prjId = value; }
}

private string _projectName;
[Column(Storage = "_projectName")]
public string projectName
{
get { return _projectName; }
set { _projectName = value; }
}

private string _prjDescription;
[Column(Storage = "_prjDescription")]
public string prjDescription
{
get { return _prjDescription; }
set { _prjDescription = value; }
}

private string _logo;
[Column(Storage = "_logo")]
public string logo
{
get { return _logo; }
set { _logo = value; }
}
private string _prjFriendlyTitle;
[Column(Storage = "_prjFriendlyTitle")]
public string prjFriendlyTitle
{
get { return _prjFriendlyTitle; }
set { _prjFriendlyTitle = value; }
}

private int _page_count;
public int page_count
{
get { return _page_count; }
set { _page_count = value; }
}

}



This my class in which the columns from sql table are mapped, but the last entity (page_count) in the above class is not from table. And in the select query I select all the columns from table and one column (page_count) is derived and calculated into the query . But when the data comes into this column is null… why it is ..? can anyone please tell me..?
Tags: C# (C# 4.0)

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900