الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مشكلة في اظهار البيانات

مغلق
بدأه الأقصى_الأسير في 12 مارس 2005 · 1 رد · 444 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بسم الله الرحمن الرحيم

اخواني الاعزاء / السلام عليكم ورحمة الله وبركاته

انا مبتدئ ب asp.net وعملت هذا المشروع البسيط

private void Page_Load(object sender, System.EventArgs e)
  {
 	 // Put user code to initialize the page here
 	 SqlConnection con = new SqlConnection
    ("server=(ahmed);database=Northwind;Trusted_Connection=yes");
 	 SqlDataAdapter dadap=new SqlDataAdapter("select * from Customers",con );
 	 DataSet ds = new DataSet();
 	 dadap.SelectCommand.CommandText=
    ("select * from Customers");
 	 
 	 dadap.Fill(ds,"Customers");
 	 DataGrid1.DataSource=ds.Tables["Customers"].DefaultView;
 	 DataGrid1.DataBind();

 	 }

ولكن ظهرت عندي هذه المشكلة

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 34:   	 ("select * from Customers");
Line 35:    
Line 36:    dadap.Fill(ds,"Customers");
Line 37:    DataGrid1.DataSource=ds.Tables["Customers"].DefaultView;
Line 38:    DataGrid1.DataBind();


Source File: c:\inetpub\wwwroot\webapplication4\webform1.aspx.cs    Line: 36

ارجو المساعدة

#2

لو لم تقم بتغيير إعدادات ال SQL Server قم بتعديل اسم السيرفر إلى Local كالتالي

SqlConnection con = new SqlConnection
   ("server=(local);database=Northwind;Trusted_Connection=yes");

و إن قمت بعمل Instance جديدة لل SQL Server بإسم أحمد اكتب التالي دون الأقواس :

SqlConnection con = new SqlConnection
   ("server=ahmed;database=Northwind;Trusted_Connection=yes");

You can fly while you can touch the sky

هذا الموضوع مغلق.

مواضيع مشابهة