+ Reply to Thread
Results 1 to 2 of 2

Thread: view data in gridview

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    11

    view data in gridview

    Hello , i am creating a simple GUI with a gridview to display a database items on the gridview , can you help me with that and thanks in advance.

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    30
    Here is how to view data into gridview :
    Code:
                DataSet ds = new DataSet();
                SqlDataAdapter msd = new SqlDataAdapter();
    
                msd.SelectCommand = new SqlCommand("SELECT * FROM test", connectionstring);
                c.Open();
    
                msd.Fill(ds);
    
                dataGridView1.DataSource = ds.Tables[0];
    
                msd.SelectCommand.ExecuteNonQuery();
    
                c.Close();

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

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