Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Function Show() As ActionResult
Try
Dim vcon = connobj.makeConnection()
Dim vTrans = vcon.BeginTransaction(Data.IsolationLevel.ReadCommitted)
Dim qry1 = "Select * from testdemo"
Dim ds As New DataSet
Dim da = New OdbcDataAdapter(qry1, vcon)
da.SelectCommand.Transaction = vTrans

da.Fill(ds, "testdemo")

vTrans.Commit()
Dim lmd As New List(Of modeldata)()

For Each dr As DataRow In ds.Tables(0).Rows
lmd.Add(New modeldata() With
{
.nUserID = Convert.ToInt64(dr("id")),
.sfname = dr("fname").ToString(),
.slname = dr("lname").ToString()
})

Next
Return View(lmd)

vcon.Close()
'Return View("Index", ds.Tables.ToString())
Catch ex As Exception
ex.Message().ToString()
Finally
End Try
Return View()
End Function
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900