That will really depend on how you have your text data arranged.
If you just have a single text box with values in it, and you want to convert that to a DataGridView (with a button push), you could do something like this:
private void button1_Click(object sender, EventArgs e)
from arr_str in textBox1.Text.ToString().Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
Converted = arr_str.Trim()
this time grid view is working and record are inserted into database but only 1 record are inserted in database if i inserted 2nd record then 1st record are override in grid view and also inserted 2nd record in database.......
i have two text fields and one comboBox and one button for insert data in gridview.
I don't use DataSet and it's associated classes.
Is it possible for you to simplify this by eliminating the use of the data rows, tables and adapters and just issue the SQL directly for the insert?
[after you fix the problem...]
The data is pulled out of the controls twice -- once for the DataGridView and then again for the DataRow in the insert() method. Is it possible to make one function that does the select, one that does the insert, one that does the update but where NONE involve the display?
That way you can just pass the data to and from the functions without having to deal with the visual at the same time.
Once the data is processed, you can update the display.
hey guys ,can u suggest me a code for this sutaion.
in my project ,i want to add a data in gridview at run time and that have to store in my data base and my projects is a window base application.
i know about insert a data from database into gridview but not know anything about this .....
plz help me and suggest me a code for this...