Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 Data saving error

$
0
0
Hi

I am using vb.net with sql server 2010, i am trying to save a single record in my table, pl see code


Dim sqlStr As String = "SELECT * From TblLostSale where 1=2"
Dim conn As New System.Data.OleDb.OleDbConnection(ConStr)
Dim ds As DataSet = New DataSet()
Dim da As New System.Data.OleDb.OleDbDataAdapter(sqlStr, conn)
da.Fill(ds)

ds.Tables(0).Rows.Add()
ds.Tables(0).Rows(0).Item("ComputerNumber") = 123
da.Update(ds, "TblLostSale")

it shows an error
Update unable to find TableMapping['TblLostSale'] or DataTable 'TblLostSale'.

please help out and let me know what is the error.

Thanks
Ladak

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>