| | |
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
Views: 2416 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2005 2008 access application arithmetic array basic binary bing button buttons c# center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dll dropdownlist error excel file-dialog folder ftp google hardcopy highlighting image images inline listview login math mobile ms navigate net networking opacity output peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project reports" save savedialog searchbox serial server soap sorting sql string syntax tcp text textbox timer toolbox trim updown upload usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





