Click here to Skip to main content
15,991,071 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
             LinkButton lnk = e.Row.FindControl("LinkButton1") as LinkButton;
             lnk.Click += new EventHandler(LinkButton1_Click);
        }
    }
protected void LinkButton1_Click(object sender, EventArgs e)
   {

   }
Posted

VB
Dim conn As New SqlConnection("Data Source=TECH4; Database=test_vs; Integrated Security=SSPI")
Dim command As New SqlCommand("p1", conn)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add("@agent_name", SqlDbType.VarChar).Value = TextBox1.Text
command.Parameters.Add("@phone_number", SqlDbType.VarChar).Value = TextBox2.Text
command.Parameters.Add("@uid", SqlDbType.VarChar).Value = TextBox3.Text
conn.Open()
command.ExecuteNonQuery()
conn.Close()


I ran your code through http://converter.telerik.com/[^].
 
Share this answer
 
Comments
ProEnggSoft 26-Mar-12 5:49am    
Good link. +5
Abhinav S 26-Mar-12 6:09am    
Thank you.
VB
Protected Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs)
    If e.Row.RowType = DataControlRowType.DataRow Then
        Dim lnk As LinkButton = TryCast(e.Row.FindControl("LinkButton1"), LinkButton)
        lnk.Click += New EventHandler(AddressOf LinkButton1_Click)
    End If
End Sub
Protected Sub LinkButton1_Click(sender As Object, e As EventArgs)

End Sub


As can be found here:
http://www.developerfusion.com/tools/convert/csharp-to-vb/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900