Visual Studio Server Explorer connection test successful but linq to sql query fails

426 Views Asked by At

I have a werid problem. I am trying Linq to sql. I created my dataconnection to sql server via sql credentials. The test connection is fine and can see tables when I expand on server explorer but when I try and run my link to sql it errors saying failed to login.

I am just trying to get 1 value back matching on a where clause.

private static string FindUser(string picFileName)
        {
            DataClasses1DataContext dataContext = new DataClasses1DataContext();
            string userlogin = (from Directory in dataContext.Directories
                                where Directory.picFile == picFileName
                               select Directory.userLogin)
                               .FirstOrDefault();
            return userlogin;
        }
0

There are 0 best solutions below