返回首页

如何转换成C#代码vb.net 1.0版本2.0(2005)(2000)
我曾尝试以下的网站转换的R转换从2005年至2005年


{A}
邮政
解决方案
否则说在VS 2000的GridView的解决方案是无法使用,所以我用DataGrid控件。中,DataGrid控件的Rows属性是不是可用。


    protected void btnadddata_Click(object sender, EventArgs e)

    {

        SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=TNVKP_8;Integrated Security=True");

        for (int i = 0; i < GridView2.Rows.Count; i++)

        {

            //GridViewRow row = GridView1.Rows[i];

            //CheckBox chkbox = (CheckBox)row.FindControl("chkbox1");

            CheckBox chkbox = (CheckBox)GridView2.Rows[i].FindControl("chkbox1");

            Label label1 = (Label)GridView2.Rows[i].FindControl("Label1");

            Label label2 = (Label)GridView2.Rows[i].FindControl("Label2");

            Label label3 = (Label)GridView2.Rows[i].FindControl("Label3");

            Label label4 = (Label)GridView2.Rows[i].FindControl("Label4");

            Label label5 = (Label)GridView2.Rows[i].FindControl("Label5");

            Label label6 = (Label)GridView2.Rows[i].FindControl("Label6");

            Label label7 = (Label)GridView2.Rows[i].FindControl("Label7");

            Label label8 = (Label)GridView2.Rows[i].FindControl("Label8");

            Label label9 = (Label)GridView2.Rows[i].FindControl("Label9");

            Label label10 = (Label)GridView2.Rows[i].FindControl("Label10");

            if (chkbox.Checked == true) //&& (row.Cells[11].Text=="Ok")

            {

                con.Open();

                string str;

                str = "insert into employee (empid,empname,empaddress,empcity,empstate,empzip,emplic,empstatus,empp,empi) values('" + label1.Text + "','" + label2.Text + "','" + label3.Text + "','" + label4.Text + "','" + label5.Text + "','" + label6.Text + "','" + label7.Text + "','" + label8.Text + "','" + label9.Text + "','" + label10.Text + "')";

                SqlCommand com = new SqlCommand(str, con);

                com.ExecuteNonQuery();

                con.Close();

            }

            Label1.Text = "Records inserted";

        }

    }

回答

评论会员:游客 时间:2012/02/07
{A2}使用此链接到你的代码转换
Monjurul哈比卜
评论会员:游客 时间:2012/02/07
以下是在线代码转换链接的网站{A3的}{A4纸}{A5的}]
Jαved:您好,
试试这个链接,

{A6的}]
评论会员:游客 时间:2012/02/07
bluesathish:您好,这是为那些使用夏普开发C#答案只需选择你想要你的代码要转换的菜单语言:{BR}工具代码转换为GT;NBSP嘘C#中Python的红宝石VB.Net你瞬间转换代码比重建整个项目在VB.Net的解决方案。Perić_Željko
Convert.ToDateTime(txtDateTimeDiag.CalendarDate.ToString());