Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

Link as Grid Datasource

Is there any advantages in using LINQ to call a stored procedure in my vb code?

My attached code below works fine...just wondering.
Dim objConn1 As SqlConnection
objConn1 = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnPortal"))
Dim oCom1 As SqlCommand
oCom1 = New SqlCommand
oCom1.Connection = objConn1
oCom1.CommandText = "sp_crmSS_leadListGet"
oCom1.CommandType = CommandType.StoredProcedure
oCom1.Parameters.Add(New SqlParameter("@searchName", SqlDbType.NVarChar, 50)).Value = Session("SearchName").ToString
Dim dA As SqlDataAdapter = New SqlDataAdapter(oCom1)
dT = New DataTable
objConn1.Open()
Try
    dA.Fill(dT)
Finally
    objConn1.Close()
End Try
objConn1.Dispose()
oCom1.Dispose()

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Larry Brister

ASKER

Thanks