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
anitha T
NA
73
8k
Data source is an invalid type
Jun 27 2017 4:39 AM
i got error as
Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource.
BL b = new BL();
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string X = Convert.ToString(e.CommandArgument);
int index = Convert.ToInt32(X);
GridViewRow row = (GridViewRow)GridView1.Rows[index];
Label id = (Label)row.FindControl("lbl1");
int artid = Convert.ToInt32(id.Text);
GridView1.DataSource =b.DeleteProList(artid);
GridView1.DataBind();
}
DAL:
public int DeleteProList(int proId)
{
con.Open();
SqlCommand cmd = new SqlCommand("sp_deleteProjectList", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@ProjectId", proId);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
int i = Convert.ToInt32(cmd.ExecuteNonQuery());
return i;
}
BL:
public int DeleteProList(int proId)
{
return d.DeleteProList(proId);
}
Reply
Answers (
2
)
Elastic Search, Log stash
To decrease loading time for ASP.NET MVC application