Results 1 to 3 of 3

Thread: datagrid in vs2002 versus vs2005 express edtion

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    datagrid in vs2002 versus vs2005 express edtion

    hi,
    this code is work well in vs2002 C# but not in vs2005 express edition. Any have idea about the issue here? Or someone can give me in detail on how to put data to a datagrid in vs2005?

    Code:
    dataset ds = new dataset();					
    MySqlDataAdapter myadapter =	new MySqlDataAdapter();		
    myadapter.SelectCommand = new MySqlCommand();
    myadapter.SelectCommand.Connection  = stsqcon.getConnection();
    myadapter.SelectCommand.CommandText = " Select * from partmain a inner 
    join appmodel b on a.p_code=b.p_code inner join vehicle c on c.veh_code = 
    b.veh_code where b.veh_code =?veh_code order by p_desc";
    myadapter.SelectCommand.Parameters.Add("?veh_code",MySqlDbType.Int32 ,4);
    myadapter.SelectCommand.Parameters["?veh_code"].Value = lv1.SelectedItems[0].SubItems[1].Text;
    myadapter.Fill(ds,"partmain");		
    dataGrid1.DataSource = ds;
    thanks,

    Popskie
    Last edited by popskie; Nov 15th, 2005 at 12:31 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: datagrid in vs2002 versus vs2005 express edtion

    And what exactly is the problem in 2005? You say the code doesn't work well but you give no indication of the symptoms. The DataGrid is still available in .NET 2.0 but the DataGridView would be the way to go unless you have a good reason not to use it. It is a different beast though, so it will not behave exactly the same way.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: datagrid in vs2002 versus vs2005 express edtion

    Ohhhh shame on my self jm. Im too careless about datagrid and datagridview. LOL
    thanks jm for reminding me. heheh.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width