Hata: SQL Server does not exist or access denied.

Delphi .net ve .net ile ilgili konuları buraya yazabilirsiniz.
Cevapla
karamemet
Üye
Mesajlar: 5
Kayıt: 28 Ara 2004 06:42

Hata: SQL Server does not exist or access denied.

Mesaj gönderen karamemet »

procedure TGlobal.Session_Start(sender: System.Object; e: EventArgs);
const
c_cnstr = 'server=localhost;database=Northwind;Trusted_Connection=Yes';
c_sel = 'select FirstName, LastName, Title from Employees;';
var
sqlCn: SqlConnection;
sqlDA: SqlDataAdapter;
sqlCmd: SqlCommand;
ds: DataSet;
RowNum: System.Int32;
NumRows: System.Int32;
begin
sqlCn := SqlConnection.Create(c_cnstr);
sqlCmd := SqlCommand.Create(c_sel, sqlCn);
sqlDA := SqlDataAdapter.Create(sqlCmd);
ds := DataSet.Create;
sqlDA.Fill(ds);
try
Session.Add('Employees', ds.Tables['Table']);
RowNum := 1;
NumRows := ds.Tables['Table'].Rows.Count - 1;
Session.Add('RowNum', System.Object(RowNum));
Session.Add('NumRows', System.Object(NumRows));
finally
sqlCn.Close;
end;
end;

bu kod blogunu çalıştırdığımda
explorer şu hatayı veriyor
(sql server kurulu)

Server Error in '/SimpleDBBind' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error:


Line 74: sqlDA := SqlDataAdapter.Create(sqlCmd);
Line 75: ds := DataSet.Create;
Line 76: sqlDA.Fill(ds);
Line 77: try
Line 78: Session.Add('Employees', ds.Tables['Table']);
Cevapla