السلام عليكــم ورحمـة الله وبركاتــه
أريد ربط صفحة asp.net بلغة سي شارب 2005 هل هناك control لابد من استخدامها لعمل الاتصال أم يمكنني الاستعانة بالكود فقط ؟؟
اثناء المحاولات وبعد البحث وجدت الكود التالي
protected void Page_Load(object sender, EventArgs e) {
// Define database connection
SqlConnection conn = new SqlConnection(
"Server=AL-BE976D91F295\\SQLEXPRESS;Database=BegCsarpEvent;" +
"Integrated Security=True");
SqlCommand comm = new SqlCommand(
"SELECT id, title FROM Events", conn);
// Open connection
conn.Open();
// Execute the command
SqlDataReader reader = comm.ExecuteReader();
// TODO: Do something with the data
// Close the reader and the connection
reader.Close();
conn.Close();
}
ولكن هناك خطأ في SqlConnection ,
SqlCommand,
SqlDataReader
لم يتعرف على النوع البياني ,حيث انني استخدم C# 2005