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
darma teja
NA
496
337.3k
Loop problem to insert the data into database.
Nov 22 2013 3:35 AM
Hi All,
I have a loop problem to insert data into my databank.
I have three columns called:
Customer Order Canceled?
Darma
CPU false
Mouse false
Phone true
Keyboard false
Teja Mobile false
Ipad false
MP3 false
CPU true
I actually got this list from excel file and stored it into aspxgrid.
If canceled == true; than I should not insert into my databank.
I stored this values into List.
List<object> Customer = ASPxGridView1.GetSelectedFieldValues("Customer");
List<object> Order = ASPxGridView1.GetSelectedFieldValues("Order");
List<object> Canceled = ASPxGridView1.GetSelectedFieldValues("Canceled");
// Get index value of canceled == false and stored it into "insertdata";
var insertdata = Enumerable.Range(0, Canceled.Count)
.Where(i => Canceled[i].ToString() == "false")
.ToList();
for (int i = 0; i < insertdata.Count; i++)
{
if (Customer[insertdata[i]].ToString() != "")
{
//My logic to insert the data into database
//But with the above logic I can insert two rows of data into database.
Darma
CPU
Teja Mobile
*****I wanted to insert the following data in database*********
Darma
CPU false
Mouse false
Keyboard false
Teja Mobile false
Ipad false
MP3 false
}
}
Thanks in advance
Darma
Reply
Answers (
0
)
How i Create Parametrize Thread in c#.Net in ForEach Loop
Datetime conversion error