24-07-13, 07:17 AM
شكرا ليك اخى بس نفس المشكلة برضو
[HTML]Protected Sub DataList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataList1.SelectedIndexChanged
Dim strConnString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim con As New SqlConnection(strConnString)
If ConnectionState.Open Then con.Close()
Dim itemIndex As Integer = 9
Dim label As Label = DataList1.Items(itemIndex).FindControl("name_ProductsLabel")
Dim text As String = label.Text
Dim str As String = "SELECT * from name_Products WHERE (name_Products=N'" & text & "')"
Dim cmd As SqlCommand = New SqlCommand(Str, con)
cmd.Connection = con
con.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
While (dr.Read())
'Label2.Text = dr("Text_book").ToString()
Label1.Text = ""
Label1.Text = dr("name_Products")
End While
dr.Close()
End Sub[/HTML]
[HTML]Protected Sub DataList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataList1.SelectedIndexChanged
Dim strConnString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim con As New SqlConnection(strConnString)
If ConnectionState.Open Then con.Close()
Dim itemIndex As Integer = 9
Dim label As Label = DataList1.Items(itemIndex).FindControl("name_ProductsLabel")
Dim text As String = label.Text
Dim str As String = "SELECT * from name_Products WHERE (name_Products=N'" & text & "')"
Dim cmd As SqlCommand = New SqlCommand(Str, con)
cmd.Connection = con
con.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
While (dr.Read())
'Label2.Text = dr("Text_book").ToString()
Label1.Text = ""
Label1.Text = dr("name_Products")
End While
dr.Close()
End Sub[/HTML]
يَامَعْشَرَ الْجِنِّ وَالإِنسِ إِنْ اسْتَطَعْتُمْ أَنْ تَنفُذُوا مِنْ أَقْطَارِ السَّمَاوَاتِ وَالأَرْضِ فَانفُذُوا لا تَنفُذُونَ إِلاّ بِسُلْطَانٍ(33) سورة الرحمن
