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
Shiva Tiwari
NA
73
5.3k
I want to insert selected image into database
May 29 2020 2:36 AM
public
void
BindImages()
{
try
{
string
query =
"select * from Images where Prod_id=@Id"
;
SqlCommand cmd =
new
SqlCommand(query, EcomConString);
cmd.Parameters.AddWithValue(
"@Id"
, SqlDbType.VarChar).Value = id;
cmd.CommandType = CommandType.Text;
SqlDataAdapter sda =
new
SqlDataAdapter(cmd);
DataTable dt =
new
DataTable();
sda.Fill(dt);
if
(dt.Rows.Count > 0)
{
foreach
(DataRow dr
in
dt.Rows)
{
strImages += @
"<li><img src='/"
+ dr[
"Img"
] + @
"' class='img-thumbnail' alt='' /></li>"
;strThumbImage += dr[
"Img"
].ToString() +
","
;
}
}
}
catch
(Exception ex) { }
}
Reply
Answers (
4
)
Entering multiple information in view before posting
How to avoid entry of duplicate attribute?