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
724
1.3k
101.7k
How to insert SessionID into table using asp.net?
Jul 17 2019 2:58 AM
i want to insert Session ID of user into table ,
if
(Session[
"EmpID"
] ==
null
)
{
Response.Redirect(
"LogingForm.aspx"
);
}
here is my insert Button code
protected
void
tbsv_Click(
object
sender, EventArgs e)
{
{
{
if
(ddlBbitem.SelectedValue ==
""
)
{
Response.Write(
"<script>alert('Please Select Item Name')</script>"
);
}
else
if
(prdbqty.Text ==
""
)
{
Response.Write(
"<script>alert('Please Input Weight')</script>"
);
}
else
{
con.Open();
SqlCommand cmd =
new
SqlCommand(
"spInsertbigbale"
, con);
cmd.CommandType = CommandType.StoredProcedure;
// cmd.Parameters.AddWithValue("@RollNo", TextBox4.Text.Trim());
cmd.Parameters.AddWithValue(
"@Codeitem"
, ddlBbitem.SelectedValue);
cmd.Parameters.AddWithValue(
"@Bweight"
, prdbqty.Text.Trim());
cmd.Parameters.AddWithValue(
"@Bpqty"
, opbbqty.Text.Trim());
cmd.Parameters.AddWithValue(
"@CID"
, DDLBBCID.SelectedValue);
cmd.Parameters.AddWithValue(
"@SecID"
, DDLBBsec.SelectedValue);
cmd.Parameters.AddWithValue(
"@EntryDate"
, txtbpentrydate.Text);
cmd.Parameters.Add(
"@BID"
, SqlDbType.Int);
cmd.Parameters[
"@BID"
].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
int
ResultValue = Convert.ToInt32(cmd.Parameters[
"@BID"
].Value);
if
(ResultValue > 1)
{
Response.Redirect(
"BigBalePrintView.aspx?BID="
+ ResultValue +
""
);
}
else
{
Response.Write(
"<script>alert('Record Not save')</script>"
);
}
con.Close();
}
}
}
Reply
Answers (
5
)
Modal popup extender opens and chart disappears in ASP.Net?
How to create Web API curd using Ado.Net