Where is my mistake?
Posted
by Hakan
on Stack Overflow
See other posts from Stack Overflow
or by Hakan
Published on 2010-06-08T13:09:55Z
Indexed on
2010/06/08
13:12 UTC
Read the original article
Hit count: 393
vb.net
I have table which is connected to datagridview and I would like to enter new data by using text boxes. I have following code but it gives me error. Will be appreciated if you help me.
Dim meter As DataTable = Me.DataSet1.Tables.Item("tblmeters")
Dim row As DataRow = meter.NewRow()
row.Item("No") = Me.txtno.Text
row.Item("Turnover") = Me.txtturnover.Text
row.Item("Total Win") = Me.txttotalwin.Text
row.Item("Games Played") = Me.txtgamesplayed.Text
row.Item("Credit In") = Me.txtcreditin.Text
row.Item("Bill In") = Me.txtbillin.Text
row.Item("Hand Pay") = Me.txthandpay.Text
row.Item("Date") = DateTime.Today.ToShortDateString
meter.Rows.Add(row)
Me.TblMeterTableAdapter.Update(Me.DataSet1.tblMeter)
meter.AcceptChanges()
© Stack Overflow or respective owner