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
Guest User
Tech Writer
189
25k
Cannot implicitly convert type 'void' to 'string'
May 23 2018 2:24 AM
BAL.cs
public
void
Delete(string id)
{
cmd =
new
MySqlCommand(
"DeleteProduct"
, con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(
"in_ProductId"
, id);
con.Open();
int
i = cmd.ExecuteNonQuery();
con.Close();
}
Home Controller
public
ActionResult DeleteProduct(
string
id)
{
try
{
BAL objBAL =
new
BAL();
string
product = objBAL.Delete(id);
//error
if
(product !=
null
)
{
Response.Write(
"<script>alert('Data Deleted Successfully')</script>"
);
}
}
catch
(Exception ex)
{
throw
ex;
}
}
Reply
Answers (
1
)
There is no ViewData item of type 'IEnumerable<SelectListIte
Replace the name instead of code