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
subh
NA
4.5k
0
datagrid datasource error
Mar 13 2007 10:05 AM
In my application iam using a public function binding which is for binding dataset to datagrid in webform1. I am calling this fuction from another web form say webform2. I got error in Datagrid1.Datasource
line saying {"Object reference not set to an instance of an object." }
I am not passing dataset . Just calling the binding function which
runs query, fill dataset & set the datasource of datagrid to dataset.
webform1:
public void binding()
{try
{someclass objsomeclass= new someclass();
DataGrid1.DataSource=someclass.somefunction();
DataGrid1.DataBind();
}
catch(Exception exc)
{ Response.Write(exc.Message);}
}
this function is working fine in webform1 . But when i call this function from webform2 , datagrid.Datasource throws error .
webform2 button click:
webform1 objwebform1 =new webform1();
objwebform1.binding();
pls let me know where i am going wrong....
Thanks .
Reply
Answers (
0
)
OnServerValidate not firing for custom validator
Images in datagrid!