Click here to Skip to main content
15,867,453 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# directory folder levels Pin
Eddy Vluggen9-Sep-12 0:23
professionalEddy Vluggen9-Sep-12 0:23 
AnswerRe: C# directory folder levels Pin
jschell9-Sep-12 4:30
jschell9-Sep-12 4:30 
GeneralRe: C# directory folder levels Pin
dcof9-Sep-12 8:49
dcof9-Sep-12 8:49 
GeneralRe: C# directory folder levels Pin
Pete O'Hanlon9-Sep-12 10:05
subeditorPete O'Hanlon9-Sep-12 10:05 
GeneralRe: C# directory folder levels Pin
dcof9-Sep-12 10:30
dcof9-Sep-12 10:30 
GeneralRe: C# directory folder levels Pin
Pete O'Hanlon9-Sep-12 10:35
subeditorPete O'Hanlon9-Sep-12 10:35 
AnswerRe: C# directory folder levels Pin
jschell10-Sep-12 8:55
jschell10-Sep-12 8:55 
QuestionC# linq not update table correctly Pin
classy_dog8-Sep-12 15:19
classy_dog8-Sep-12 15: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 15:14
classy_dog8-Sep-12 15:14 
AnswerRe: C# with several proejct folders using linq to sql Pin
Dave Kreskowiak8-Sep-12 16:58
mveDave Kreskowiak8-Sep-12 16:58 
GeneralRe: C# with several proejct folders using linq to sql Pin
classy_dog9-Sep-12 8:51
classy_dog9-Sep-12 8:51 
GeneralRe: C# with several proejct folders using linq to sql Pin
Dave Kreskowiak9-Sep-12 13:27
mveDave Kreskowiak9-Sep-12 13:27 
Questionmdiparent_clickevent dosnt work right Pin
mohammadkaab8-Sep-12 0:28
mohammadkaab8-Sep-12 0:28 
AnswerRe: mdiparent_clickevent dosnt work right Pin
Eddy Vluggen8-Sep-12 4:46
professionalEddy Vluggen8-Sep-12 4:46 
QuestionDisplay Live TV Pin
Jassim Rahma7-Sep-12 22:28
Jassim Rahma7-Sep-12 22:28 
AnswerRe: Display Live TV Pin
Eddy Vluggen8-Sep-12 4:41
professionalEddy Vluggen8-Sep-12 4:41 
QuestionHow to retrieve dell drac ip's via c sharp? Pin
turbosupramk37-Sep-12 10:28
turbosupramk37-Sep-12 10:28 
QuestionGenerics Problems Pin
Kevin Marois7-Sep-12 7:11
professionalKevin Marois7-Sep-12 7:11 
AnswerRe: Generics Problems Pin
Clifford Nelson7-Sep-12 7:23
Clifford Nelson7-Sep-12 7:23 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 7:27
professionalKevin Marois7-Sep-12 7:27 
AnswerRe: Generics Problems Pin
Clifford Nelson7-Sep-12 7:42
Clifford Nelson7-Sep-12 7:42 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 8:02
professionalKevin Marois7-Sep-12 8:02 
GeneralRe: Generics Problems Pin
Ennis Ray Lynch, Jr.7-Sep-12 8:51
Ennis Ray Lynch, Jr.7-Sep-12 8:51 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 8:55
professionalKevin Marois7-Sep-12 8:55 
GeneralRe: Generics Problems Pin
Ennis Ray Lynch, Jr.7-Sep-12 9:05
Ennis Ray Lynch, Jr.7-Sep-12 9: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.