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
piyusha patravali
NA
40
0
multiple insert value
Oct 25 2013 7:34 AM
HI
I want to insert multiple values of checkbox list in single column seperated by comma.my insert code is
---------------------------------------
SQL CODE
Insert into PR_LWFSetting(SrNo, MonApp ) Select SrNo, MonApp From OPENXML (@DocPR_LWFSetting, '/PR_LWFSetting/Row',2)
WITH (
SrNo int 'SrNo',
MonApp varchar(50) 'MonApp'
)
------------------------------------------
ASP .NET
save code
xmlPR_LWFSetting.Append("<MonApp>");
xmlPR_LWFSetting.Append(SelectedValue);
//xmlPR_LWFSetting.Append(this.chkMonth.SelectedValue)xmlPR_LWFSetting.Append("</MonApp>");
where code for SelectedValue is
string SelectedValue = string.Empty, blankValue = string.Empty;
foreach (ListItem item in chkMonth.Items)
{
if (item.Selected)
{
SelectedValue += item.Value + ",";
}
else
{
blankValue += item.Value + ",";
}
}
I am getting an error
Conversion failed when converting the varchar value '1,2,' to data type int
Reply
Answers (
1
)
MVC4
Gridview - Textbox autoincrement