Click here to Skip to main content
16,012,110 members

Comments by Member 10419145 (Top 12 by date)

Member 10419145 9-Dec-13 8:23am View    
Yes
Member 10419145 5-Dec-13 8:02am View    
Thanks for your help. But by doing so the whole page is being refreshed, I donot want that to happen.
Member 10419145 5-Dec-13 6:35am View    
Where I should include this code?
Member 10419145 5-Dec-13 6:29am View    
I am not getting any error at the same time image is not stored in folder and data is not stored in DB
Member 10419145 3-Dec-13 1:40am View    
This is my coding for getting data in gridview:

Protected Sub SearchButton_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SearchButton.Click
If IsPostBack Then
Dim sql As String
Dim adapter As New SqlDataAdapter

Dim Command As SqlCommand = New SqlCommand
Dim connection As SqlConnection = New SqlConnection("Server=pc1207;uid=sa;pwd=welcome3#;database=IRDB")

sql = "select * from tblQuestionbank "
Try

connection.Open()
Command = New SqlCommand(sql, connection)

adapter.SelectCommand = Command
adapter.Fill(ds)
'GridView1.DataSource = Command.ExecuteReader
GridView1.DataSource = ds.Tables(0)
ViewState("data") = ds.Tables(0)
GridView1.DataBind()

connection.Close()
Catch ex As Exception
End Try
End If
End Sub

And my coding for "Gridview_selectedindex" event is:

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged
TextBox1.Text = GridView1.SelectedRow.Cells(1).Text
TextBox2.Text = GridView1.SelectedRow.Cells(2).Text
TextBox3.Text = GridView1.SelectedRow.Cells(3).Text

And I donot know the coding to get the image in "Image" control.