• 9 odgovora
  • 4.529 pregleda
Problem sa connection string-om 27.07.2008. u 01:01 · pre 222 meseci #1
Pokusavam da se konektujem na bazu sledecim kodom o dobijam...
Code:

private string connectionString = @"Server=VLADA-PC\SQLEXPRESS;Database=SMSMessages;user id=sa;password=";

Code:

try
            {
                sqlConnection = new SqlConnection ();
                sqlConnection.ConnectionString = getConnectionString();
                sqlConnection.Open();
            }
            catch (Exception ex)
            {
                throw ex;
            }

Na liniji sqlConnection.Open(); mi izbaci:
Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.
Re: Problem sa connection string-om 27.07.2008. u 09:26 · pre 222 meseci #2
Verovatno trebaš podesiti Authentication Mode u SQL Serveru na Mixed. ( a ne samo Windows)
Potpis
Free advice is seldom cheap.
Re: Problem sa connection string-om 27.07.2008. u 09:57 · pre 222 meseci #3
Ima Windows authentication mode i SQL Server and Windows authentication mode. Ovo drugo mi je cekirano i dalje javlja isti problem?
Re: Problem sa connection string-om 27.07.2008. u 10:36 · pre 222 meseci #4
Code:

@"Data Source=VLADA-PC\SQLEXPRESS;Initial Catalog=SMSMessages;Integrated Security=True; ";

Napravio sam novi connection string i sada radi :)
Re: Problem sa connection string-om 20.08.2008. u 15:00 · pre 221 meseci #7
recimo:
Code:

SqlConnection Conn = new SqlConnection(SQL_CONNECTION_STRING);


ili

Code:

SqlCommand Conn = new SqlCommand("Select * from Neka_Tabela", SQL_CONNECTION_STRING);


SQL_CONNECTION_STRING je u ovom slucaju konstanta koju smo predhodno definisali.
Potpis
SELECT * FROM หน่วยงานหลัก WHERE ยสันติ LIKE 'โดย%'
Re: Problem sa connection string-om 20.08.2008. u 17:50 · pre 221 meseci #8
Ma OK to, to znam, nego me interesuje u kom tacno sloju to treba da bude kodirano?
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme