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
Satish
NA
184
99k
Linq query instead of foreach loop
Aug 4 2017 1:53 AM
public static void InsertWsdiResult(AppDefinition appdef)
{
if(appdef.Id == null)
throw new ArgumentNullException("appdef.Id");
foreach (var connector in appdef.WSDIConnectors)
{
foreach (var token in connector.DataMapOperations)
{
using (DbCommand cmd = new CommandBuilder()
.SetCommandText("IQ_InsertWsdiTokens")
.SetCommandType(CommandType.StoredProcedure)
.AddInputParameter<Guid>("@AppID", appdef.Id)
.AddInputParameter<Guid?>("@FieldID", token.To.Id)
.AddInputParameter<string>("@Expression", token.Expression.Code)
.ToDbCommand())
{
cmd.ExecuteNonQuery();
}
}
}
}
How to use linq query in above code instead of two foreach loops
Thanks
Reply
Answers (
2
)
error when opening form designer ?
WIA Scanner Issue when hosted in server