TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sreekanth v
NA
51
0
Getting error in gridview using object data source
Sep 6 2011 3:36 AM
It
is
displaying empty
in
gridview i think problem
in
Business
Object
.
please help me
.
I am fed up i am trying
from
last
night
.
in
BO
.
cs
namespace
Business_Object
{
public
class
company
:
Icompany
{
int
_empid
=
0
;
public
int
empid
{
set
{
if
(
value
!=
_empid
)
_empid
=
value
;
}
get
{
return
_empid
;
}
}
string
_empname
;
public
string
empname
{
get
{
return
_empname
;
}
set
{
value
=
_empname
;
}
}
int
_jobid
;
public
int
?
jobid
{
get
{
return
_jobid
;
}
set
{
value
=
_jobid
;
}
}
DateTime
_hiredate
;
public
DateTime
?
hiredate
{
get
{
return
_hiredate
;
}
set
{
value
=
_hiredate
;
}
}
}
}
in
BLL
.
cs
namespace
BLL
{
public
class
Employees
{
public
List
<company>
GetEmployees
()
{
company c
=
new
company
();
CompanyDataContext
db
=
new
CompanyDataContext
();
List
<company>
listemp
=
new
List
<company>
();
listemp
=
(
from
p
in
db
.
Employees
select
new
company
{
empid
=
c
.
empid
,
empname
=
c
.
empname
,
jobid
=
c
.
jobid
,
hiredate
=
c
.
hiredate
}).
ToList
();
return
listemp
;
}
}
}
in
default
.
aspx
.
cs
<
asp
:
GridView
ID
=
"GridView1"
runat
=
"server"
DataSourceID
=
"ObjectDataSource1"
AutoGenerateColumns
=
"False"
>
<
Columns
>
<
asp
:
BoundField
DataField
=
"empid"
HeaderText
=
"empid"
SortExpression
=
"empid"
/>
<
asp
:
BoundField
DataField
=
"empname"
HeaderText
=
"empname"
SortExpression
=
"empname"
/>
<
asp
:
BoundField
DataField
=
"jobid"
HeaderText
=
"jobid"
SortExpression
=
"jobid"
/>
<
asp
:
BoundField
DataField
=
"hiredate"
HeaderText
=
"hiredate"
SortExpression
=
"hiredate"
/>
<
/Columns>
</
asp
:
GridView
>
<
asp
:
ObjectDataSource
ID
=
"ObjectDataSource1"
runat
=
"server"
DataObjectTypeName
=
"BusinessObject.ompany"
TypeName
=
"BLL.Employees"
SelectMethod
=
"GetEmployees"
>
</
asp
:
ObjectDataSource
>
Reply
Answers (
3
)
My grid is not display on the web form
Problem with javascript confirm box