N
N
Nikolai Kupstas2011-10-05 20:52:46
C++ / C#
Nikolai Kupstas, 2011-10-05 20:52:46

Misunderstandings with MS SQL

private readonly StorageDataContext _storage = new StorageDataContext(@"server = .\SQLEXPRESS;Integrated Security = SSPI; database = Storage");
 ViewBag.Title = _storage.Page.SingleOrDefault(item => item.PageName == "Index").PageTitle;


An exception is thrown:

Cannot open database 'Storage' requested by login. Failed to sign in.
Login failed for user 'Illorian-PC\Illorian'.

Tell me how to solve, plz!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AigizK, 2011-10-05
@AigizK

In C#, you can connect like this: Data Source=.\SQLEXPRESS;Initial Catalog=Storage; Integrated Security=True ;

S
sergeyZ, 2011-10-05
@sergeyZ

Persist Security Info=True

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question