locked
Can't get to the name of the connected user RRS feed

  • Question

  • User1622294484 posted

    Hey guys , 

    I'm trying to write  a code wich search if the pseudo of the user exists in the DB, if yes I want to get his name but it seems not working ,here is my code 

     using (nEntities ctx = new nEntities())
                    {  
                        try
                        {
                            authentification t = (from t1 in ctx.authentification
                                                  where ((t1.pseudo == TextBox1.Text) & (t1.passwd== TextBox2.Text))
                                                  select t1).First();
                            if (t.pseudo != TextBox1.Text)
                            {
                                a = false;
                                //type = t.type;
                            }
                            else
                            {
                                a = true;
                                nom = t.name;
    
                            }
    
                        }
                        catch
                        {
    
                        }
                    }

    so the problem iswhen I affect nom=t.name it underlines it in red .why ? 

    Thursday, March 28, 2013 2:03 AM

Answers

  • User1622294484 posted

    Well I get it now, it's because the name exists on another table not the authentification one .

    So I have to get it from the other table

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 28, 2013 2:08 AM

All replies

  • User1622294484 posted

    Well I get it now, it's because the name exists on another table not the authentification one .

    So I have to get it from the other table

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 28, 2013 2:08 AM
  • User-166373564 posted

    Hi kryptong

    Well I get it now, it's because the name exists on another table not the authentification one .

    So I have to get it from the other table

    Thanks for sharing your solution with us, if you have anything urgent in your future programming, please feedback by creating another thread,

    With kind regards

    Monday, April 8, 2013 4:41 AM