Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
how to convert c# code version 2.0(2005) to vb.net 1.0(2000)
i have tried the following sites to convert but that r convert from 2005 to 2005

1
2
post solution for this

or otherwise say solution for this in VS 2000 gridview is not available, so i used datagrid control in that. In that datagrid control Rows property is not available.
C#
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";
    }
}
Posted
Updated 6-Dec-11 23:14pm
v5
Comments
sriman.ch 7-Dec-11 5:08am    
In datagrid use item property instead of row...

If you're trying to go BACKWARDS, your best bet is to go ahead and convert it as normal, and then manually change the code to be compatible with the appropriate older version of .Net.
 
Share this answer
 
Comments
Monjurul Habib 9-Dec-11 15:15pm    
best way , my 5!
www.developerfusion.com/tools/Convert/csharp-to-vb/

use this link to convert ur code
 
Share this answer
 
v2
Comments
Monjurul Habib 9-Dec-11 15:15pm    
5!
Prashant Srivastava LKO 13-Feb-12 6:47am    
thank you sir
 
Share this answer
 
Comments
Monjurul Habib 9-Dec-11 15:14pm    
5!
Jαved 13-Dec-11 3:02am    
Thanks.
 
Share this answer
 
Hello,
This is the answer for those who use Sharp Develop C #
simply select on the menu language you want yours code to be converted :

Tools
Convert code to >

Boo
C#
Python
Ruby
VB.Net

you have instantly converted code,
and than rebuild whole project to have solution in VB.Net.
 
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