0

hi, i'm having a bit of trouble with grid views. see i can show stuff in them but i want to manipulate and use a certain selected record or field in it ( e.g : delete it from table in the DB or copy it into a textbox.). i'll be so grateful if you could add some code snippets too. thanks guys...

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Mitja Bonca
0

hi, i'm having a bit of trouble with grid views. see i can show stuff in them but i want to manipulate and use a certain selected record or field in it ( e.g : delete it from table in the DB or copy it into a textbox.). i'll be so grateful if you could add some code snippets too. thanks guys...

Code for grid view....

string connectionString = "Data Source=.;Initial Catalog=pubs;Integrated Security=True";
            string sql = "SELECT * FROM Authors";
            SqlConnection connection = new SqlConnection(connectionString);
            SqlDataAdapter dataadapter = new SqlDataAdapter(sql, connection);
            DataSet ds = new DataSet();
            connection.Open();
            dataadapter.Fill(ds, "Authors_table");
            connection.Close();
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "Authors_table";

if you use listview then you can manipulate ....

Edited by sathish88: n/a

0

hi, i'm having a bit of trouble with grid views. see i can show stuff in them but i want to manipulate and use a certain selected record or field in it ( e.g : delete it from table in the DB or copy it into a textbox.). i'll be so grateful if you could add some code snippets too. thanks guys...

And I would be grateful to read more good info about the issue. You are not clear enough here - so some additional explanation is surely required - if you want any decent help.

Mitja

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.