Click here to Skip to main content
15,884,298 members
Home / Discussions / Database
   

Database

 
GeneralRe: large database Pin
V.18-Jul-15 0:12
professionalV.18-Jul-15 0:12 
GeneralRe: large database Pin
Mycroft Holmes18-Jul-15 0:45
professionalMycroft Holmes18-Jul-15 0:45 
GeneralRe: large database Pin
V.18-Jul-15 8:25
professionalV.18-Jul-15 8:25 
GeneralRe: large database Pin
Jörgen Andersson20-Jul-15 11:01
professionalJörgen Andersson20-Jul-15 11:01 
AnswerRe: large database Pin
GuyThiebaut18-Jul-15 1:19
professionalGuyThiebaut18-Jul-15 1:19 
GeneralRe: large database Pin
V.18-Jul-15 8:23
professionalV.18-Jul-15 8:23 
GeneralRe: large database Pin
GuyThiebaut18-Jul-15 8:37
professionalGuyThiebaut18-Jul-15 8:37 
QuestionSQL Linq, updating multiple records Pin
jkirkerx15-Jul-15 10:50
professionaljkirkerx15-Jul-15 10:50 
I know how to update a single record, but updating multiple records is different.

Single
Dim uTemplate As CRM_JOBS = context.crm_Jobs.Single(Function(m) m.templateName = templateName)
uTemplate.templateXHTML = sEMT.templateXHTML
uTemplate.templateID = pValue
context.SaveChanges()

I thought of this for multiple records, but items doesn't carry over to the loop.
So would I have to project it into something and then save?
Dim jobs =
From items In context.crm_Jobs
Where items.templateName = templateName

For Each items In jobs
 jobs.templateXHTML = sEMT.templateXHTML
 jobs.templateID = pValue
Next
context.SaveChanges()

[edit]
I have this now
Dim jobs =
  From j In context.crm_Jobs
  Where j.templateName = templateName
  Select j

  For Each j As CRM_JOBS In jobs
    j.templateXHTML = sEMT.templateXHTML
    j.templateID = sEMT.templateID
  Next

  context.SaveChanges()

Oh that works!

modified 15-Jul-15 17:32pm.

QuestionSave value of PREPARE into a variable Pin
Jassim Rahma14-Jul-15 22:23
Jassim Rahma14-Jul-15 22:23 
AnswerRe: Save value of PREPARE into a variable Pin
Wendelius14-Jul-15 22:45
mentorWendelius14-Jul-15 22:45 
GeneralRe: Save value of PREPARE into a variable Pin
Jassim Rahma15-Jul-15 22:22
Jassim Rahma15-Jul-15 22:22 
GeneralRe: Save value of PREPARE into a variable Pin
Wendelius15-Jul-15 22:51
mentorWendelius15-Jul-15 22:51 
AnswerRe: Save value of PREPARE into a variable Pin
jschell15-Jul-15 10:45
jschell15-Jul-15 10:45 
QuestionSome help with SQL to Linq Conversions Pin
jkirkerx13-Jul-15 7:04
professionaljkirkerx13-Jul-15 7:04 
AnswerRe: Some help with SQL to Linq Conversions Pin
Richard Deeming13-Jul-15 7:18
mveRichard Deeming13-Jul-15 7:18 
GeneralRe: Some help with SQL to Linq Conversions Pin
jkirkerx13-Jul-15 7:34
professionaljkirkerx13-Jul-15 7:34 
General[Got It] Pin
jkirkerx13-Jul-15 7:58
professionaljkirkerx13-Jul-15 7:58 
GeneralRe: Some help with SQL to Linq Conversions Pin
Richard Deeming13-Jul-15 8:00
mveRichard Deeming13-Jul-15 8:00 
QuestionSQL Linq, query and then take result to query again Pin
jkirkerx10-Jul-15 7:43
professionaljkirkerx10-Jul-15 7:43 
Answer[Solved] Pin
jkirkerx10-Jul-15 8:53
professionaljkirkerx10-Jul-15 8:53 
QuestionSELECT then INSERT data in a matrix way Pin
Farhad Eft9-Jul-15 9:14
Farhad Eft9-Jul-15 9:14 
AnswerRe: SELECT then INSERT data in a matrix way Pin
Richard Deeming9-Jul-15 9:22
mveRichard Deeming9-Jul-15 9:22 
GeneralRe: SELECT then INSERT data in a matrix way Pin
Farhad Eft9-Jul-15 10:51
Farhad Eft9-Jul-15 10:51 
QuestionSQL Linq, concepts of writing queries Pin
jkirkerx8-Jul-15 8:55
professionaljkirkerx8-Jul-15 8:55 
AnswerRe: SQL Linq, concepts of writing queries Pin
Richard Deeming8-Jul-15 10:46
mveRichard Deeming8-Jul-15 10:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.