Search Results

Search found 56 results on 3 pages for 'refracted paladin'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Implementing Read Only view in Winform App

    - by Refracted Paladin
    I have an in house winform app for viewing, editing, and inserting member data. There are about 40 sepertate form pages that they use to manipulate different portions of the data. My question is this; What is the best way of implementing a read only view for a form page? My thoughts were to cycle through the controls setting Enabled = False or leave them be but not allow any data changes(no Save Button etc) unless it is "unlocked". I am curious how others handle this with WinForm apps?

    Read the article

  • Resharper and var

    - by Refracted Paladin
    I have Resharper 4.5 and have found it invaluable so far but I have a concern; It seems to want to make every variable declaration implicit(var). As a relativly new developer how much should I trust ReSharper when it comes to this? Take the below code snippet from a method that Paints Tab Headers. TabPage currentTab = tabCaseNotes.TabPages[e.Index]; Rectangle itemRect = tabCaseNotes.GetTabRect(e.Index); SolidBrush fillBrush = new SolidBrush(Color.Linen); SolidBrush textBrush = new SolidBrush(Color.Black); StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; Resharper wants me to change all 5 of those to var. I have read the following similar post,Use of var keyword in C#, but I would like to know from a Resharper standpoint. Thanks!

    Read the article

  • Convert SQL with Inner AND Outer Join to L2S

    - by Refracted Paladin
    I need to convert the below Sproc to a Linq query. At the very bottom is what I have so far. For reference the fields behind the "splat"(not my sproc) are ImmunizationID int, HAReviewID int, ImmunizationMaintID int, ImmunizationOther varchar(50), ImmunizationDate smalldatetime, ImmunizationReasonID int The first two are PK and FK, respectively. The other two ints are linke to the Maint Table where there description is stored. That is what I am stuck on, the INNER JOIN AND the LEFT OUTER JOIN Thanks, SELECT tblHAReviewImmunizations.*, tblMaintItem.ItemDescription, tblMaintItem2.ItemDescription as Reason FROM dbo.tblHAReviewImmunizations INNER JOIN dbo.tblMaintItem ON dbo.tblHAReviewImmunizations.ImmunizationMaintID = dbo.tblMaintItem.ItemID LEFT OUTER JOIN dbo.tblMaintItem as tblMaintItem2 ON dbo.tblHAReviewImmunizations.ImmunizationReasonID = tblMaintItem2.ItemID WHERE HAReviewID = @haReviewID My attempt so far -- public static DataTable GetImmunizations(int haReviewID) { using (var context = McpDataContext.Create()) { var currentImmunizations = from haReviewImmunization in context.tblHAReviewImmunizations where haReviewImmunization.HAReviewID == haReviewID join maintItem in context.tblMaintItems on haReviewImmunization.ImmunizationReasonID equals maintItem.ItemID into g from maintItem in g.DefaultIfEmpty() let Immunization = GetImmunizationNameByID( haReviewImmunization.ImmunizationMaintID) select new { haReviewImmunization.ImmunizationDate, haReviewImmunization.ImmunizationOther, Immunization, Reason = maintItem == null ? " " : maintItem.ItemDescription }; return currentImmunizations.CopyLinqToDataTable(); } } private static string GetImmunizationNameByID(int? immunizationID) { using (var context = McpDataContext.Create()) { var domainName = from maintItem in context.tblMaintItems where maintItem.ItemID == immunizationID select maintItem.ItemDescription; return domainName.SingleOrDefault(); } }

    Read the article

  • LINQ DefaultIfEmpty(), generating inferred argument error

    - by Refracted Paladin
    I am trying to get the below linq query to return -1 if there isn't any current value. I was looking at this article on MSDN, here, and it seemed that DefaultIfEmpty() was what I wanted. Unfortunately, I am getting a The type arguments cannot be inferred from the usage. Try specifying the type arguments explicitly. error. I guess I am not sure what that means or what it is telling me to do. Can someone explain, please. public static int CheckForDRIID(int personID) { using (var context = ConnectDataContext.Create()) { var masterIndex = (from applicationAssociation in context.tblApplicationAssociations where applicationAssociation.ApplicationID == 1 && applicationAssociation.PersonID == personID select applicationAssociation.PersonApplicationID).DefaultIfEmpty(-1).Single(); return Convert.ToInt32(masterIndex); } }

    Read the article

  • Why should I use Entity Framework over Linq2SQL ...

    - by Refracted Paladin
    To be clear, I am not asking for a side by side comparision which has already been asked Ad Nauseum here on SO. I am also Not asking if Linq2Sql is dead as I don't care. What I am asking is this.... I am building internal apps only for a non-profit organization. I am the only developer on staff. We ALWAYS use SQL Server as our Database backend. I design and build the Databases as well. I have used L2S successfully a couple of times already. Taking all this into consideration can someone offer me a compelling reason to use EF instead of L2S? I was at Code Camp this weekend and after an hour long demonstration on EF, all of which I could have done in L2S, I asked this same question. The speakers answer was, "L2S is dead..." Very well then! NOT! (see here) I understand EF is what MS WANTS us to use in the future(see here) and that it offers many more customization options. What I can't figure out is if any of that should, or does, matter for me in this environment. One particular issue we have here is that I inherited the Core App which was built on 4 different SQL Data bases. L2S has great difficulty with this but when I asked the aforementioned speaker if EF would help me in this regard he said "No!"

    Read the article

  • WinForm - WPF integration; Piece by Piece

    - by Refracted Paladin
    I have a medium sized WinForm App (1 Form that hosts 40 user controls) that we use in house. I want to migrate over to WPF but I cannot do a Mass ReRelease. My idea was, for now, to recreate the App 1 User Control at a time in WPF and have that hosted in the existing WinForm App. I would make them look nearly identical, at this point, so there would be no need for mass retraining. My question is more to the point of, has any one else tried this and how does the data portion work. I have recreated one of the WinForms User Controls as a WPF user Control. Do I need to publish that as a User Control Library? How, then, would I access the DAL for that UC? I use a Linq to Sql data layer.

    Read the article

  • Expression Studio 4 Premium & SketchFlow question; WTH

    - by Refracted Paladin
    Through work I have an Visual Studio Premium with MSDN subscription that I love. However, my biggest disappointment of the last 12 months was discovering that our 2nd from the top level subscription was not enough to get me Sketchflow! This is, most decidedly, NOT SHINY, and I am borderline distraught! What are my options? Upgrading to an Ultimate subscription for Sketchflow is out of the question. Am I forced, then, to stay with Blend 3 or Purchase Blend 4 seperately? If this is not a question I should ask here please inform and I'll delete. I just tend to default to SO for all questions that Google can't answer and Google did not answer this one.

    Read the article

  • Why use Entity Framework over Linq2SQL ...

    - by Refracted Paladin
    To be clear, I am not asking for a side by side comparision which has already been asked Ad Nauseum here on SO. I am also Not asking if Linq2Sql is dead as I don't care. What I am asking is this.... I am building internal apps only for a non-profit organization. I am the only developer on staff. We ALWAYS use SQL Server as our Database backend. I design and build the Databases as well. I have used L2S successfully a couple of times already. Taking all this into consideration can someone offer me a compelling reason to use EF instead of L2S? I was at Code Camp this weekend and after an hour long demonstration on EF, all of which I could have done in L2S, I asked this same question. The speakers answer was, "L2S is dead..." Very well then! NOT! (see here) I understand EF is what MS WANTS us to use in the future(see here) and that it offers many more customization options. What I can't figure out is if any of that should, or does, matter for me in this environment. One particular issue we have here is that I inherited the Core App which was built on 4 different SQL Data bases. L2S has great difficulty with this but when I asked the aforementioned speaker if EF would help me in this regard he said "No!"

    Read the article

  • Unable to add Solution to TFS 2010 due to existing (invisible)binding

    - by Refracted Paladin
    I have a smallish utility library I made that I had created in TFS Beta 2 to test out TFS. I now have TFS rc1 installed(and Beta 2 uninstalled) and am trying to add my Solution to TFS. I get an error saying that it is already bound to my old TFS, which was on a different system then this one. Strangely, when I go into Source Control and look at the bindings it says there aren't any. Also, I manually deleted the .vss and .vsc files and it still does it. Ideas? I looked through the numerous other SO topics related to this but unless I missed one none of them are dealing with my issue. Ideas?

    Read the article

  • I Clean Solution'd my Winform App and now it's broken...

    - by Refracted Paladin
    I have a Winform App that uses a 3rd Party Library of Controls, DevExpress. I also created a bunch of Controls myself, extending those controls. Everything has been working fine when all of a sudden I opened VS today and on the Design Page all my extended controls were missing. I then tried rebuilding to no avail. Then I tried Cleaning and Rebuilding and made it even worse. Now I have tons(520) of erros stating things like -- Error 179 The name 'datBirthDate' does not exist in the current context D:\Documents\Visual Studio 2008\Projects\MatrixReloaded\MatrixReloaded\Controls\Member\ucGeneral.cs 339 17 MatrixReloaded also if I try to open a form or user control in Design Mode I first get this -- could not find type, "MyType" please make sure that the assembly that contains this type is referenced and then, if I click Ignore and Continue I get this for all Forms and Contros when I try and look at them in Design Mode -- Exception of type System.OutOfMemoryException was thrown Help!?!? When I googled I came across mostly references to VS 2003...I am on 2008 sp1.

    Read the article

  • How to add second JOIN clause in Linq To Sql?

    - by Refracted Paladin
    I am having a lot of trouble coming up with the Linq equivalent of this legacy stored procedure. The biggest hurdle is it doesn't seem to want to let me add a second 'clause' on the join with tblAddress. I am getting a Cannot resolve method... error. Can anyone point out what I am doing wrong? Below is, first, the SPROC I need to convert and, second, my LINQ attempt so far; which is FULL OF FAIL! Thanks SELECT dbo.tblPersonInsuranceCoverage.PersonInsuranceCoverageID, dbo.tblPersonInsuranceCoverage.EffectiveDate, dbo.tblPersonInsuranceCoverage.ExpirationDate, dbo.tblPersonInsuranceCoverage.Priority, dbo.tblAdminInsuranceCompanyType.TypeName AS CoverageCategory, dbo.tblBusiness.BusinessName, dbo.tblAdminInsuranceType.TypeName AS TypeName, CASE WHEN dbo.tblAddress.AddressLine1 IS NULL THEN '' ELSE dbo.tblAddress.AddressLine1 END + ' ' + CASE WHEN dbo.tblAddress.CityName IS NULL THEN '' ELSE '<BR>' + dbo.tblAddress.CityName END + ' ' + CASE WHEN dbo.tblAddress.StateID IS NULL THEN '' WHEN dbo.tblAddress.StateID = 'ns' THEN '' ELSE dbo.tblAddress.StateID END AS Address FROM dbo.tblPersonInsuranceCoverage LEFT OUTER JOIN dbo.tblInsuranceCompany ON dbo.tblPersonInsuranceCoverage.InsuranceCompanyID = dbo.tblInsuranceCompany.InsuranceCompanyID LEFT OUTER JOIN dbo.tblBusiness ON dbo.tblBusiness.BusinessID = dbo.tblInsuranceCompany.BusinessID LEFT OUTER JOIN dbo.tblAddress ON dbo.tblAddress.BusinessID = dbo.tblBusiness.BusinessID and tblAddress.AddressTypeID = 'b' LEFT OUTER JOIN dbo.tblAdminInsuranceCompanyType ON dbo.tblPersonInsuranceCoverage.InsuranceCompanyTypeID = dbo.tblAdminInsuranceCompanyType.InsuranceCompanyTypeID LEFT OUTER JOIN dbo.tblAdminInsuranceType ON dbo.tblPersonInsuranceCoverage.InsuranceTypeID = dbo.tblAdminInsuranceType.InsuranceTypeID WHERE tblPersonInsuranceCoverage.PersonID = @PersonID var coverage = from insuranceCoverage in context.tblPersonInsuranceCoverages where insuranceCoverage.PersonID == personID join insuranceCompany in context.tblInsuranceCompanies on insuranceCoverage.InsuranceCompanyID equals insuranceCompany.InsuranceCompanyID join address in context.tblAddresses on insuranceCompany.tblBusiness.BusinessID equals address.BusinessID where address.AddressTypeID = 'b' select new { insuranceCoverage.PersonInsuranceCoverageID, insuranceCoverage.EffectiveDate, insuranceCoverage.ExpirationDate, insuranceCoverage.Priority, CoverageCategory = insuranceCompany.tblAdminInsuranceCompanyType.TypeName, insuranceCompany.tblBusiness.BusinessName, TypeName = insuranceCoverage.InsuranceTypeID, Address = };

    Read the article

  • A better UPDATE method in LINQ to SQL

    - by Refracted Paladin
    The below is a typical, for me, Update method in L2S. I am still fairly new to a lot of this(L2S & business app development) but this just FEELs wrong. Like there MUST be a smarter way of doing this. Unfortunately, I am having trouble visualizing it and am hoping someone can provide an example or point me in the right direction. To take a stab in the dark, would I have a Person Object that has all these fields as Properties? Then what, though? Is that redundant since L2S already mapped my Person Table to a Class? Is this just 'how it goes', that you eventually end up passing 30 parameters(or MORE) to an UPDATE statement at some point? For reference, this is a business app using C#, WinForms, .Net 3.5, and L2S over SQL 2005 Standard. Here is a typical Update Call for me. This is in a file(BLLConnect.cs) with other CRUD methods. Connect is the name of the DB that holds tblPerson When a user clicks save() this is what is eventually called with all of these fields having, potentially, been updated-- public static void UpdatePerson(int personID, string userID, string titleID, string firstName, string middleName, string lastName, string suffixID, string ssn, char gender, DateTime? birthDate, DateTime? deathDate, string driversLicenseNumber, string driversLicenseStateID, string primaryRaceID, string secondaryRaceID, bool hispanicOrigin, bool citizenFlag, bool veteranFlag, short ? residencyCountyID, short? responsibilityCountyID, string emailAddress, string maritalStatusID) { using (var context = ConnectDataContext.Create()) { var personToUpdate = (from person in context.tblPersons where person.PersonID == personID select person).Single(); personToUpdate.TitleID = titleID; personToUpdate.FirstName = firstName; personToUpdate.MiddleName = middleName; personToUpdate.LastName = lastName; personToUpdate.SuffixID = suffixID; personToUpdate.SSN = ssn; personToUpdate.Gender = gender; personToUpdate.BirthDate = birthDate; personToUpdate.DeathDate = deathDate; personToUpdate.DriversLicenseNumber = driversLicenseNumber; personToUpdate.DriversLicenseStateID = driversLicenseStateID; personToUpdate.PrimaryRaceID = primaryRaceID; personToUpdate.SecondaryRaceID = secondaryRaceID; personToUpdate.HispanicOriginFlag = hispanicOrigin; personToUpdate.CitizenFlag = citizenFlag; personToUpdate.VeteranFlag = veteranFlag; personToUpdate.ResidencyCountyID = residencyCountyID; personToUpdate.ResponsibilityCountyID = responsibilityCountyID; personToUpdate.EmailAddress = emailAddress; personToUpdate.MaritalStatusID = maritalStatusID; personToUpdate.UpdateUserID = userID; personToUpdate.UpdateDateTime = DateTime.Now; context.SubmitChanges(); } }

    Read the article

  • Compare Created DateTime to DateTime.Today at 6pm, C#

    - by Refracted Paladin
    In C# I need to compare the value of DateTime.Today /6pm, to a field that stores the Created DateTime. Basically there is certain functionality that is only accessible on the same day as the created day and then only till 6pm. The part I am not fully understanding is how to accurately represent 6pm on Today to compare against. Is there a method that always returns, say, Midnight that I can then do a .AddHours(18); to? Am I over-complicating this? Thanks.

    Read the article

  • WPF or Silverlight Learning Resources for Business Applications

    - by Refracted Paladin
    I am the only developer at a non-profit organization(~200 employees) where we are a M$ shop and 90% of the things I develop are specific to our company and are internal only. I am given a lot of latitude on how I accomplish my goals so using new technologies is in my best interest. So far I have developed all winform & asp.net applications. I would now like to focus on XAML driven development(WPF & Silverlight) and would like your help. I am subscribed to numerous Silverlight blogs and I have went through a few good tutorials however, I would really appreciate a GOOD SOLID book in my hands going forward. I prefer learning books versus reference books and I REALLY would like one from a Business standpoint as well. Shameless, self-promoting is welcomed if you happen to be an author or reviewer for one that meets my criteria. I would, however, prefer that recomendations were based on first-hand experience(no, 'my friend as this awesome book he told me about', please). Though, I don't mind un-released books if say they are an updated version of an existing. disclaimer -- I know there are an insane amount of Book posts here(SO) but none I believe for my specific need. If there is and I missed it I apologize.

    Read the article

  • SQL Temp Tables & Replication

    - by Refracted Paladin
    I have had an issue with our replication process and would like to salvage some data. I have a process in place where I will connect to each subscriber before flagging them for reinitialization and I will run the below to pull any data they may have entered in during the "dark time". I am pretty sure this will work in a vanilla palace. What I am unsure of is whether the Global Temporary Table will persist through DB Replication. To be clear, I am not trying to Replicate the TempTable, I just want to make sure it will still exist at the local DB after the Replication so I may run the INSERT from it. Thoughts? USE MemberCenteredPlan -- Select Data from tblPLan SELECT * INTO ##MyPlan FROM tblPlan WHERE PlanID = 407869 --------------------------- -- Run Replication Process --------------------------- -- Insert Plan back into DB INSERT INTO tblPlan SELECT * FROM ##MyPlan WHERE PlanID = 407869 -- Drop Global Temp Table DROP TABLE ##MyPlan --------------------------- -- Run Replication Process ---------------------------

    Read the article

  • Find a part of UNC path and put in a variable?

    - by Refracted Paladin
    I am trying to peel off the last part of a unc path that is being passed and put it in a variable to use in a method further down the line. Example path would be -- \\ourfileserver\remoteuploads\countyfoldername\personfoldername How do I peel just the countyfoldername out of that? I had thought to try var th = e.FullPath.LastIndexOf('\\'); var whichFolder = folderPath.Substring(th); but that is an escape character and it doesn't like @ either. Is this even the right direction?

    Read the article

  • Proper way to structure a Sync Framework DAL

    - by Refracted Paladin
    I am creating a WPF app that needs to allow users to work in a temporary disconnected state and I plan to use a Local Database Cache. My question's are about my data access layer. Do you typically create the whole DAL to point at the Cache or both and create a switching mechanism? Is Entity's a good way to go for my DAL against the Cache? I am used to L2S but my understanding is that I can't use that against SQLCE, correct? Thanks! PS: Any good resources out there for using Sync, Linq, and WPF ALL TOGETHER? Tutorials, videos, etc?

    Read the article

  • Copy Rows in a One to Many with LINQ (2 SQL)

    - by Refracted Paladin
    I have a table that stores a bunch of diagnosis for a single plan. When the users create a new plan I need to copy over all existing diagnosis's as well. I had thought to try the below but this is obviously not correct. I am guessing that I will need to loop through my oldDiagnosis part, but how? Thanks! My Attempt so far... public static void CopyPlanDiagnosis(int newPlanID, int oldPlanID) { using (var context = McpDataContext.Create()) { var oldDiagnosis = from planDiagnosi in context.tblPlanDiagnosis where planDiagnosi.PlanID == oldPlanID select planDiagnosi; var newDiagnosis = new tblPlanDiagnosi { PlanID = newPlanID, DiagnosisCueID = oldDiagnosis.DiagnosisCueID, DiagnosisOther = oldDiagnosis.DiagnosisOther, AdditionalInfo = oldDiagnosis.AdditionalInfo, rowguid = Guid.NewGuid() }; context.tblPlanDiagnosis.InsertOnSubmit(newDiagnosis); context.SubmitChanges(); } }

    Read the article

  • WPF/Silverlight Resources for Businesses

    - by Refracted Paladin
    I am the only developer at a non-profit organization(~200 employees) where we are a M$ shop and 90% of the things I develop are specific to our company and are internal only. I am given a lot of latitude on how I accomplish my goals so using new technologies is in my best interest. So far I have developed all winform & asp.net applications. I would now like to focus on XAML driven development(WPF & Silverlight) and would like your help. I am subscribed to numerous Silverlight blogs and I have went through a few good tutorials however, I would really appreciate a GOOD SOLID book in my hands going forward. I prefer learning books versus reference books and I REALLY would like one from a Business standpoint as well. Shameless, self-promoting is welcomed if you happen to be an author or reviewer for one that meets my criteria. I would, however, prefer that recomendations were based on first-hand experience(no, 'my friend as this awesome book he told me about', please). Though, I don't mind un-released books if say they are an updated version of an existing. If more info is needed to provide accurate recomendations please let me know. Thanks disclaimer -- I know there are an insane amount of Book posts here(SO) but none I believe for my specific need. If there is and I missed it I apologize.

    Read the article

  • Copy Rows in a One to Many with LINQ to SQL

    - by Refracted Paladin
    I have a table that stores a bunch of diagnosis for a single plan. When the users create a new plan I need to copy over all existing diagnosis's as well. I had thought to try the below but this is obviously not correct. I am guessing that I will need to loop through my oldDiagnosis part, but how? Thanks! My Attempt so far... public static void CopyPlanDiagnosis(int newPlanID, int oldPlanID) { using (var context = McpDataContext.Create()) { var oldDiagnosis = from planDiagnosi in context.tblPlanDiagnosis where planDiagnosi.PlanID == oldPlanID select planDiagnosi; var newDiagnosis = new tblPlanDiagnosi { PlanID = newPlanID, DiagnosisCueID = oldDiagnosis.DiagnosisCueID, DiagnosisOther = oldDiagnosis.DiagnosisOther, AdditionalInfo = oldDiagnosis.AdditionalInfo, rowguid = Guid.NewGuid() }; context.tblPlanDiagnosis.InsertOnSubmit(newDiagnosis); context.SubmitChanges(); } }

    Read the article

  • Silverlight and Active Directory Interaction

    - by Refracted Paladin
    I am planning to familiarize(read teach) myself with Silverlight by building an in-house app for managing our employees. I, obviously, would need this to interact with Active Directory on some level. What are my options? Has anyone tried this before? I am currently going to explore using Services(WCF???) to do the AD interaction portion? Thoughts? There is also this SO Post on using PowerShell to interact with AD. Maybe that is a possibility? Thanks, EDIT: Too clarify what I meant by "...interact with Active Directory..." I was referring to being able to create New Users, reset they're passwords, change they're Member Of groups, etc. Not JUST authenticating through AD. Does this make it clearer?

    Read the article

  • Form.Show() is not showing it's child controls

    - by Refracted Paladin
    I have a form, frmPleaseWait, that has a MarqueeProgressBar and a Label that I want to use when the UI is loading the data in a poorly structured app we have. The problem is that frmPleaseWait.Show() shows the form but not the controls in it. It is just a white rectangle. Now frmPleaseWait.ShowDialog() shows the child controls but doesn't let the UI load it's data. What am I missing? Below is a code snippet from where I am trying this. PleaseWait = new frmPleaseWait(); PleaseWait.Show(this); // Set all available HUD values in HUD Object HUD.LastName = GetCurrentRowVal("LastName").Trim(); HUD.FirstName = GetCurrentRowVal("FirstName").Trim(); HUD.PersonId = Convert.ToInt32(GetCurrentRowVal("PersonID").Trim()); HUD.SSn = GetCurrentRowVal("SSN").Trim(); HUD.MiddleName = GetCurrentRowVal("MiddleName").Trim(); HUD.MasterID = ConnectBLL.BLL.DriInterface.CheckForDriId(HUD.PersonId).ToString(); // This loads numerous UserControls with data shellForm.FormPaint(HUD.PersonId); PleaseWait.Close();

    Read the article

  • 'Timeout Expired' error against local SQL Express on only 2 LINQ Methods...

    - by Refracted Paladin
    I am going to sum up my problem first and then offer massive details and what I have already tried. Summary: I have an internal winform app that uses Linq 2 Sql to connect to a local SQL Express database. Each user has there own DB and the DB stay in sync through Merge Replication with a Central DB. All DB's are SQL 2005(sp2or3). We have been using this app for over 5 months now but recently our users are getting a Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Detailed: The strange part is they get that in two differnt locations(2 differnt LINQ Methods) and only the first time they fire in a given time period(~5mins). One LINQ method is pulling all records that match a FK ID and then Manipulating them to form a Heirarchy View for a TreeView. The second is pulling all records that match a FK ID and dumping them into a DataGridView. The only things I can find in common with the 2 are that the first IS an IEnumerable and the second converts itself from IQueryable - IEnumerable - DataTable... I looked at the query's in Profiler and they 'seemed' normal. They are not very complicated querys. They are only pulling back 10 - 90 records, from one table. Any thoughts, suggestions, hints whatever would be greatly appreciated. I am at my wit's end on this.... public IList<CaseNoteTreeItem> GetTreeViewDataAsList(int personID) { var myContext = MatrixDataContext.Create(); var caseNotesTree = from cn in myContext.tblCaseNotes where cn.PersonID == personID orderby cn.ContactDate descending, cn.InsertDate descending select new CaseNoteTreeItem { CaseNoteID = cn.CaseNoteID, NoteContactDate = Convert.ToDateTime(cn.ContactDate). ToShortDateString(), ParentNoteID = cn.ParentNote, InsertUser = cn.InsertUser, ContactDetailsPreview = cn.ContactDetails.Substring(0, 75) }; return caseNotesTree.ToList<CaseNoteTreeItem>(); } AND THIS ONE public static DataTable GetAllCNotes(int personID) { using (var context = MatrixDataContext.Create()) { var caseNotes = from cn in context.tblCaseNotes where cn.PersonID == personID orderby cn.ContactDate select new { cn.ContactDate, cn.ContactDetails, cn.TimeSpentUnits, cn.IsCaseLog, cn.IsPreEnrollment, cn.PresentAtContact, cn.InsertDate, cn.InsertUser, cn.CaseNoteID, cn.ParentNote }; return caseNotes.ToList().CopyLinqToDataTable(); } }

    Read the article

  • LINQ 2 SQL Insert Error(with Guids)

    - by Refracted Paladin
    I have the below LINQ method that I use to create the empty EmploymentPLan. After that I simply UPDATE. For some reason this works perfectly for myself but for my users they are getting the following error -- The target table 'dbo.tblEmploymentPrevocServices' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause. This application is a WinForm app that connects to a local SQL 2005 Express database that is a part of a Merge Replication topology. This is an INTERNAL App only installed through ClickOnce. public static Guid InsertEmptyEmploymentPlan(int planID, string user) { using (var context = MatrixDataContext.Create()) { var empPlan = new tblEmploymentQuestionnaire { PlanID = planID, InsertDate = DateTime.Now, InsertUser = user, tblEmploymentJobDevelopmetService = new tblEmploymentJobDevelopmetService(), tblEmploymentPrevocService = new tblEmploymentPrevocService() }; context.tblEmploymentQuestionnaires.InsertOnSubmit(empPlan); context.SubmitChanges(); return empPlan.EmploymentQuestionnaireID; } }

    Read the article

< Previous Page | 1 2 3  | Next Page >