将C#代码转换为vb.net [英] convert c# code to vb.net
本文介绍了将C#代码转换为vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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)
{
}
推荐答案
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()
我通过 http://converter.telerik.com/ [
I ran your code through http://converter.telerik.com/[^].
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
可以在这里找到:
http://www.developerfusion.com/tools/convert/csharp-to-vb/ [ ^ ]
As can be found here:
http://www.developerfusion.com/tools/convert/csharp-to-vb/[^]
这篇关于将C#代码转换为vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文