| | |
Using PL/SQL in VB.net
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2007
Posts: 22
Reputation:
Solved Threads: 5
Could it be that the file does not only contain PL/SQL? Comments in PL/SQL are
or
Calling PL/SQL from VB .NET may basically be performed by executing the PL/SQL text like:
but there are traps for example using multiple PL/SQL statements in one call to "Execute...".
/* comment comment */
-- comment Calling PL/SQL from VB .NET may basically be performed by executing the PL/SQL text like:
Dim sSQL As String
Try
'create and use a function
sSQL = "CREATE OR REPLACE FUNCTION MyMultiply( " & vbLf & _
"ifactor1 IN NUMBER, " & vbLf & _
"ifactor2 IN NUMBER " & vbLf & _
") RETURN NUMBER IS" & vbLf & _
" iResult NUMBER;" & vbLf & _
"BEGIN" & vbLf & _
" iResult:=iFactor1*iFactor2;" & vbLf & _
" RETURN iResult;" & vbLf & _
"END;"
Dim aCmd As New OracleCommand(sSQL, OracleConnection1)
aCmd.CommandType = CommandType.Text
OracleConnection1.Open()
aCmd.ExecuteNonQuery()
'
aCmd.CommandText = "SELECT MyMultiply(5, 7) FROM dual"
MessageBox.Show(aCmd.ExecuteScalar().ToString)
Catch ex As Exception
MessageBox.Show(ex.ToString)
Finally
OracleConnection1.Close()
End Trybut there are traps for example using multiple PL/SQL statements in one call to "Execute...".
![]() |
Similar Threads
- Need Freelance ASP.NET, MS SQL, C#, VB.NET Developer (Web Development Job Offers)
- Freelance .NET / MS SQL developer (Web Development Job Offers)
- .Net Application Developer (Software Development Job Offers)
- Looking for a .NET guru! (Software Development Job Offers)
- .NET Consultant (Software Development Job Offers)
- ASP.Net / C# Web Developer (Web Development Job Offers)
- .NET developers team searches projects (Post your Resume)
- connecting sql to VB.NET (MS SQL)
Other Threads in the VB.NET Forum
- Previous Thread: I need help for connecting to Ms access database
- Next Thread: Hire/remove lines from gridview
| Thread Tools | Search this Thread |
.net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click client code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic eclipse editvb.net employees excel exists filter forms function html images isnumericfuntioncall listview map mobile module msaccess mssqlbackend mysql net number open page pan panel pdf picturebox picturebox2 port position print printing printpreview read record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer timespan transparency txttoxmlconverter usercontol vb vb.net vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web winsock wpf wrapingcode xml year





