Click here to Skip to main content
15,905,912 members
Home / Discussions / C#
   

C#

 
QuestionMake Solution Work with Vpn Pin
md_refay6-Aug-11 18:09
md_refay6-Aug-11 18:09 
QuestionExporting An Specific Text format Pin
nassimnastaran6-Aug-11 2:55
nassimnastaran6-Aug-11 2:55 
AnswerRe: Exporting An Specific Text format Pin
Richard MacCutchan6-Aug-11 4:14
mveRichard MacCutchan6-Aug-11 4:14 
GeneralRe: Exporting An Specific Text format Pin
nassimnastaran6-Aug-11 5:56
nassimnastaran6-Aug-11 5:56 
GeneralRe: Exporting An Specific Text format Pin
Richard MacCutchan6-Aug-11 6:09
mveRichard MacCutchan6-Aug-11 6:09 
GeneralRe: Exporting An Specific Text format Pin
Richard Andrew x646-Aug-11 7:55
professionalRichard Andrew x646-Aug-11 7:55 
GeneralRe: Exporting An Specific Text format Pin
nassimnastaran6-Aug-11 9:51
nassimnastaran6-Aug-11 9:51 
QuestionLinq SQL Help Pin
gmhanna6-Aug-11 2:42
gmhanna6-Aug-11 2:42 
Hi,

I am new to Linq and I'm trying to access the MfgNumber after the query directly without a foreach loop. I don't need the foreach loop as the SQL query should be returning one result.

C#
[Table(Name = "Mfg")]
public class Mfg
{
    [Column(IsPrimaryKey = true)]
    public string MfgName;
    [Column]
    public string MfgNumber;
}
...
    var q2 =
        from mfg in db.Mfg
        where mfg.MfgName == Common.productPublisherName
        select mfg;

       foreach (var mfg in q2)
           MfgNumber = mfg.MfgNumber; 


How do I access the variables from the query without a foreach?

Thank you,
Glenn

AnswerRe: Linq SQL Help [modified] Pin
Ravi Bhavnani6-Aug-11 5:46
professionalRavi Bhavnani6-Aug-11 5:46 
GeneralRe: Linq SQL Help Pin
Not Active6-Aug-11 16:31
mentorNot Active6-Aug-11 16:31 
GeneralRe: Linq SQL Help Pin
Ravi Bhavnani7-Aug-11 4:23
professionalRavi Bhavnani7-Aug-11 4:23 
GeneralRe: Linq SQL Help Pin
Not Active7-Aug-11 4:48
mentorNot Active7-Aug-11 4:48 
GeneralRe: Linq SQL Help Pin
Ravi Bhavnani7-Aug-11 4:53
professionalRavi Bhavnani7-Aug-11 4:53 
AnswerRe: Linq SQL Help Pin
Not Active6-Aug-11 16:30
mentorNot Active6-Aug-11 16:30 
Questioneneble/disable button via class Pin
Oslancz5-Aug-11 23:58
Oslancz5-Aug-11 23:58 
AnswerRe: eneble/disable button via class Pin
DaveyM696-Aug-11 1:15
professionalDaveyM696-Aug-11 1:15 
QuestionC# program doesnt run on some machines [modified] Pin
HighlanderGreen5-Aug-11 8:18
HighlanderGreen5-Aug-11 8:18 
AnswerRe: C# program doesnt run on some machines Pin
OriginalGriff5-Aug-11 8:23
mveOriginalGriff5-Aug-11 8:23 
AnswerRe: C# program doesnt run on some machines Pin
Ian Shlasko5-Aug-11 8:57
Ian Shlasko5-Aug-11 8:57 
AnswerRe: C# program doesnt run on some machines Pin
jschell5-Aug-11 11:42
jschell5-Aug-11 11:42 
AnswerRe: C# program doesnt run on some machines Pin
Dan Mos5-Aug-11 11:53
Dan Mos5-Aug-11 11:53 
GeneralRe: C# program doesnt run on some machines Pin
HighlanderGreen8-Aug-11 11:32
HighlanderGreen8-Aug-11 11:32 
QuestionDatagridView, COMBOBOX COLUMN, Event does not happen immediately, Pin
ThorTheBraveGod5-Aug-11 3:11
ThorTheBraveGod5-Aug-11 3:11 
QuestionLocation Translation Logic Pin
cjb1105-Aug-11 0:48
cjb1105-Aug-11 0:48 
AnswerRe: Location Translation Logic Pin
V.5-Aug-11 1:34
professionalV.5-Aug-11 1:34 

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.