title: How can I call a sqlserver function from VB.net(or C#) ? Is there some syntax like stored procedure?
body: <pre><code>Public Sub cleanTables(ByVal prOKDel As Short)
       Dim sqlParams(1) As SqlParameter
       Dim sqlProcName As String
       sqlProcName = "db.dbo.sp_mySP"
       sqlParams(1) = New SqlParameter("@OKDel", prOKDel)
       Try
           dbConn.SetCommandTimeOut(0)
           dbConn.ExecuteNonQuery(CommandType.StoredProcedure, sqlProcName, sqlParams)
       Catch ex As Exception
  
       Finally
  
       End Try
  End Sub
  </code></pre>
  
  <p>Is there</p>
  
  <pre><code> CommandType.StoredProcedure...CommandType.Function
  sqlParams(1) = New SqlParameter("@OKDel", prOKDel)...
  </code></pre>
  
  <p>and finally datatable dt = dbConn.Execute(CommandType.StoredProcedure, sqlProcName, sqlParams)</p>
  
  <p>Thanks</p>