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
Akhter HUssain
651
1.3k
103.4k
operator += cannot be applied with string and void asp.net
Apr 14 2020 3:13 AM
FOLLOWING ERROR IS COMING
operator += cannot be applied with string and void asp.net
on this below line
ResultValue +=Convert.ToString(
this
.InsertRows(s_No, v_Name, rate, s_liter, entryDate);
below
is
whole code
DataTable dt = (DataTable)ViewState[
"dt"
];
string
s_No, v_Name, rate, s_liter, entryDate, ResultValue = Convert.ToString(0);
foreach
(DataRow row
in
dt.Rows)
{
s_No = (row[
"S_No"
].ToString());
v_Name = (row[
"V_Name"
].ToString());
rate = (row[
"Rate"
].ToString());
s_liter = (row[
"S_liter"
].ToString());
entryDate = (row[
"EntryDate"
].ToString());
ResultValue +=Convert.ToString(
this
.InsertRows(s_No, v_Name, rate, s_liter, entryDate);
}
if
(ResultValue == dt.Rows.Count)
{
// Response.Redirect("BalePack.aspx");
Response.Redirect(
"Packrpt.aspx?PID="
+ I_ID +
""
);
}
else
{
Response.Write(
"<script>alert('Not Save'</script>"
);
}
}
}
private
void
InsertRows(
string
s_No,
string
v_Name,
string
rate,
string
s_liter,
string
entryDate)
{
//con.Open();
using
(SqlCommand cmd =
new
SqlCommand(
"Sp_InsertInvM"
, con))
{
cmd.Parameters.AddWithValue(
"@Action"
,
"INSERTD"
);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(
"@I_ID"
, I_ID);
cmd.Parameters.AddWithValue(
"@S_Date"
, entryDate);
cmd.Parameters.AddWithValue(
"@S_No"
, s_No);
cmd.Parameters.AddWithValue(
"@P_Price"
, rate);
cmd.Parameters.AddWithValue(
"@S_Liter"
, s_liter);
con.Open();
cmd.ExecuteNonQuery();
ScriptManager.RegisterStartupScript(
this
,
this
.GetType(),
"alert"
,
" alert('Duplicate Order Save SuccessFully.'); window.open('SOgvud.aspx');"
,
true
);
con.Close();
Reply
Answers (
2
)
how to convert binary file to wav file in .net
Draw multiple rectangle with Itextsharp pdf C#