Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Rules File Pin
Luc Pattyn3-Sep-09 9:29
sitebuilderLuc Pattyn3-Sep-09 9:29 
GeneralRe: C# Rules File Pin
ant-damage3-Sep-09 9:35
ant-damage3-Sep-09 9:35 
GeneralRe: C# Rules File Pin
ant-damage3-Sep-09 10:51
ant-damage3-Sep-09 10:51 
AnswerRe: C# Rules File Pin
stancrm3-Sep-09 8:07
stancrm3-Sep-09 8:07 
AnswerRe: C# Rules File Pin
benjymous3-Sep-09 23:11
benjymous3-Sep-09 23:11 
GeneralRe: C# Rules File Pin
ant-damage3-Sep-09 23:15
ant-damage3-Sep-09 23:15 
AnswerRe: C# Rules File Pin
ant-damage23-Mar-10 3:26
ant-damage23-Mar-10 3:26 
QuestionEntity Model Insert Help Pin
ToddHileHoffer3-Sep-09 5:42
ToddHileHoffer3-Sep-09 5:42 
I was able to get my code to work with the following, but it seems inefficient. Isn't this code calling the database multiple times to get objects before an insert. Anyone know the correct way to do this or have a link with a good example?

int baRequestTypeId = int.Parse(this.rblMode.SelectedValue);
int baAssociateTypeId = int.Parse(this.rcbAssociateType.SelectedValue);
int baBusinessTypeId = int.Parse(this.rcbBusinessType.SelectedValue);



SqlData.BusinessAssociateWorkFlowData dataContext = new BusinessAssociateWorkFlow.SqlData.BusinessAssociateWorkFlowData();
SqlData.BusinessAssociateContactChangeRequest baContact = new BusinessAssociateWorkFlow.SqlData.BusinessAssociateContactChangeRequest();

SqlData.RequestType baRequestType = (from r in dataContext.RequestType
where r.RequestTypeId == baRequestTypeId
select r).First();

SqlData.BusinessAssociateType baBusinessAssociateType = (from b in dataContext.BusinessAssociateType 
where b.BusinessAssociateTypeId == baAssociateTypeId
select b).First();


SqlData.BusinessType baBusinessType = (from b in dataContext.BusinessType
where b.BusinessTypeId == baBusinessTypeId
select b).First();
baContact.RequestType = baRequestType;
baContact.BusinessAssociateType = baBusinessAssociateType;
baContact.BusinessType = baBusinessType;
baContact.Name = this.rtbName.Text;
baContact.Abbreviation = this.rtbAbbreviation.Text;
baContact.Code = this.rtbCode.Text;
baContact.CreatedBy = User.Identity.Name;
baContact.CreatedOn = DateTime.Now;
baContact.LastModifiedBy = User.Identity.Name;
baContact.LastModifiedOn = DateTime.Now;
baContact.ContactAddress.Add(this.AddressCntrl1.GetContactAddressEntity(ref dataContext));
dataContext.SaveChanges();



I didn't get any requirements for the signature


AnswerRe: Entity Model Insert Help Pin
Not Active3-Sep-09 5:59
mentorNot Active3-Sep-09 5:59 
GeneralRe: Entity Model Insert Help Pin
ToddHileHoffer3-Sep-09 6:52
ToddHileHoffer3-Sep-09 6:52 
QuestionMemory leak on Lucene.net 2.3.2 Pin
susantasamanta853-Sep-09 5:20
susantasamanta853-Sep-09 5:20 
AnswerRe: Memory leak on Lucene.net 2.3.2 Pin
Henry Minute3-Sep-09 5:33
Henry Minute3-Sep-09 5:33 
Questionsend data to website Pin
Omar Gameel Salem3-Sep-09 5:16
professionalOmar Gameel Salem3-Sep-09 5:16 
AnswerRe: send data to website Pin
Eddy Vluggen3-Sep-09 7:12
professionalEddy Vluggen3-Sep-09 7:12 
GeneralRe: send data to website Pin
Omar Gameel Salem3-Sep-09 7:58
professionalOmar Gameel Salem3-Sep-09 7:58 
QuestionSystem.Diagnostics.Process, asyncronous reading StandardOutput and StandardError streams Pin
Jon Hulatt3-Sep-09 5:03
Jon Hulatt3-Sep-09 5:03 
AnswerRe: System.Diagnostics.Process, asyncronous reading StandardOutput and StandardError streams Pin
Heath Higgins9-Sep-09 13:10
Heath Higgins9-Sep-09 13:10 
QuestionByte to bit array problem Pin
gwithey3-Sep-09 4:58
gwithey3-Sep-09 4:58 
AnswerRe: Byte to bit array problem Pin
Henry Minute3-Sep-09 5:24
Henry Minute3-Sep-09 5:24 
GeneralRe: Byte to bit array problem Pin
Luc Pattyn3-Sep-09 5:54
sitebuilderLuc Pattyn3-Sep-09 5:54 
GeneralRe: Byte to bit array problem Pin
Henry Minute3-Sep-09 6:03
Henry Minute3-Sep-09 6:03 
GeneralRe: Byte to bit array problem Pin
Luc Pattyn3-Sep-09 6:23
sitebuilderLuc Pattyn3-Sep-09 6:23 
GeneralRe: Byte to bit array problem Pin
gwithey3-Sep-09 20:47
gwithey3-Sep-09 20:47 
QuestionWhy listview cannot received the OnDragDrop event. Pin
Fired.Fish.Gmail3-Sep-09 4:33
Fired.Fish.Gmail3-Sep-09 4:33 
AnswerRe: Why listview cannot received the OnDragDrop event. Pin
Nuri Ismail3-Sep-09 5:28
Nuri Ismail3-Sep-09 5:28 

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.