Click here to Skip to main content
15,180,782 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# directory folder levels Pin
Eddy Vluggen9-Sep-12 1:23
professionalEddy Vluggen9-Sep-12 1:23 
AnswerRe: C# directory folder levels Pin
jschell9-Sep-12 5:30
Memberjschell9-Sep-12 5:30 
GeneralRe: C# directory folder levels Pin
dcof9-Sep-12 9:49
Memberdcof9-Sep-12 9:49 
GeneralRe: C# directory folder levels Pin
Pete O'Hanlon9-Sep-12 11:05
mvaPete O'Hanlon9-Sep-12 11:05 
GeneralRe: C# directory folder levels Pin
dcof9-Sep-12 11:30
Memberdcof9-Sep-12 11:30 
GeneralRe: C# directory folder levels Pin
Pete O'Hanlon9-Sep-12 11:35
mvaPete O'Hanlon9-Sep-12 11:35 
AnswerRe: C# directory folder levels Pin
jschell10-Sep-12 9:55
Memberjschell10-Sep-12 9:55 
QuestionC# linq not update table correctly Pin
classy_dog8-Sep-12 16:19
Memberclassy_dog8-Sep-12 16:19 
I am having a problem using linq to sql in a C# desktop application that connects to sql server 2008. Basically if the CustId already exists in the Trans table, I do not want to insert a new row into the table. However the code listed below does not work.
**Note the CustId is not the primary key of the table. there is an identity key that is the primary key of the table.
eDataContext rptData = new eDataContext();
var eupdate = (from a in rptData.Tran
                                         where a.Cust_ID == CustId
                                         select a).SingleOrDefault();
                       if (eupdate != null)
                       {
                           log.Info(CustId + "already exists in the Trans table");
                       }
                       else
                       {
                           Trans subCustid = null;
                           subCustid = new Trans();
                           subCustid.Package_ID = pkgid;
                           rptData.Trans.InsertOnSubmit(subCustid);
                           rptData.SubmitChanges();
                          }

Thus can you tell me what I can do to not allow a row to be inserted into the Trans table when the CustId already exists in the table?
QuestionC# with several proejct folders using linq to sql Pin
classy_dog8-Sep-12 16:14
Memberclassy_dog8-Sep-12 16:14 
AnswerRe: C# with several proejct folders using linq to sql Pin
Dave Kreskowiak8-Sep-12 17:58
mveDave Kreskowiak8-Sep-12 17:58 
GeneralRe: C# with several proejct folders using linq to sql Pin
classy_dog9-Sep-12 9:51
Memberclassy_dog9-Sep-12 9:51 
GeneralRe: C# with several proejct folders using linq to sql Pin
Dave Kreskowiak9-Sep-12 14:27
mveDave Kreskowiak9-Sep-12 14:27 
Questionmdiparent_clickevent dosnt work right Pin
mohammadkaab8-Sep-12 1:28
Membermohammadkaab8-Sep-12 1:28 
AnswerRe: mdiparent_clickevent dosnt work right Pin
Eddy Vluggen8-Sep-12 5:46
professionalEddy Vluggen8-Sep-12 5:46 
QuestionDisplay Live TV Pin
Jassim Rahma7-Sep-12 23:28
MemberJassim Rahma7-Sep-12 23:28 
AnswerRe: Display Live TV Pin
Eddy Vluggen8-Sep-12 5:41
professionalEddy Vluggen8-Sep-12 5:41 
QuestionHow to retrieve dell drac ip's via c sharp? Pin
turbosupramk37-Sep-12 11:28
Memberturbosupramk37-Sep-12 11:28 
QuestionGenerics Problems Pin
Kevin Marois7-Sep-12 8:11
professionalKevin Marois7-Sep-12 8:11 
AnswerRe: Generics Problems Pin
Clifford Nelson7-Sep-12 8:23
MemberClifford Nelson7-Sep-12 8:23 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 8:27
professionalKevin Marois7-Sep-12 8:27 
AnswerRe: Generics Problems Pin
Clifford Nelson7-Sep-12 8:42
MemberClifford Nelson7-Sep-12 8:42 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 9:02
professionalKevin Marois7-Sep-12 9:02 
GeneralRe: Generics Problems Pin
Ennis Ray Lynch, Jr.7-Sep-12 9:51
MemberEnnis Ray Lynch, Jr.7-Sep-12 9:51 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 9:55
professionalKevin Marois7-Sep-12 9:55 
GeneralRe: Generics Problems Pin
Ennis Ray Lynch, Jr.7-Sep-12 10:05
MemberEnnis Ray Lynch, Jr.7-Sep-12 10:05 

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.