السلام عليكم
اواجه مشكلة في عمل connection بين asp.net و sql .
عندما اضع datagrid و احاول وصلها ب table بعد انشاء sqldataadapter و dataset و اكتب الcode التالي في page load :
If Not Page.IsPostBack Then
SqlDataAdapter1.Fill(Ds1)
DataGrid1.DataBind()
End If
يظهر عندي ال error التالية:
Exception Details: System.InvalidOperationException: Fill: SelectCommand.Connection property has not been initialized.
Source Error:
Line 136: 'Put user code to initialize the page here
Line 137: If Not Page.IsPostBack Then
Line 138: SqlDataAdapter1.Fill(Ds1)
Line 139: DataGrid1.DataBind()
Line 140: End If
ماذا افعل ساعدوني جزاكم الله خير