Update Datagridview in database

Posted by Ammardev under C# on 11/16/2015 | Points: 10 | Views : 387 | Status : [Member] | Replies : 3
Hello everyone, I insert the datagridview control and I link it with a datasource but I stuck to the update with this datagridview when inserting new line in database?




Responses

Posted by: Rajnilari2015 on: 11/16/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
Why? Could you please explain the problem in a little more elaborate way?

--
Thanks & Regards,
RNA Team

Ammardev, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lucygrey on: 12/28/2015 [Member] Starter | Points: 25

Up
0
Down
According to me, the DataGridView is used to show off information from a database. A table can be shown from a database in a DataGridView, utilizing the DataAdapter class and information rationale. You can undoubtedly upgrade a database from a DataGridView.

If you are looking for adding a new line into the cell of a DataGridView, then the below given code may be beneficial;

Code:

Dim DS As New DataSet("aa")
Dim tbl As DataTable = DS.Tables.Add("bb")
Dim xRow2 As DataRow = tbl.NewRow()
xRow2("Equipment") = "-Lawnmower" & vbCrLf & "-Logcutter"
tbl.Rows.Add(xRow2)
grdRented.DataSource = DS.Tables("bb")

I hope my reply helps you…thanks!




http://www.keenesystems.com/Services/SoftwareDevelopment.aspx

Ammardev, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rasagna on: 12/28/2015 [Member] Starter | Points: 25

Up
0
Down
Like select command update command also is needed.You might have forgot to mention update command in datasource.once check that.if you post the code then it will be possible to help.

Ammardev, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response