I have an old Visual Basic Application that i m trying to incorporate Oracle Database Procedures to increase speed and efficiency. However i have a problem with passing parameters from VB to the Procedure "I keep on receiving an error message of Wrong number or types of arguments". Below is the VB Code calling and passing parameters to Oracle Stored Procedure and the Declaration part of the Stored Procedure. Kindly help where i am going wrong.
---VB Code Here
Dim Rs As New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim param As New ADODB.Parameter
Dim Str As String
Dim Omwosi, Omwaka, Enyanga, Contp
Dim res As Integer
( result IN OUT NUMBER,
ChqAcNo IN VARCHAR2,
v_Locator IN VARCHAR2,
v_ChqNO IN VARCHAR2,
v_Amnt_ip IN out VARCHAR2,
v_USR_NM IN VARCHAR2,
BCODEUSER IN VARCHAR2,
CompName IN VARCHAR2,
Absid IN VARCHAR2,
ContP IN VARCHAR2,
V_imageF IN VARCHAR2,
v_imageB IN VARCHAR2,
V_CRRNT_DTNO IN VARCHAR2
First, there is no such thing as the "perfect code".
Second, you're code is throwing a warning at you that you're ignoring since the line txtSearch.Select() will never be executed.
You're returning a value of True but the function header never defines a return type.
Does the code get data from a database and bind the result to a Combobox? Sure.
Is it the perfect code to do so? There's no such thing. There is only fitness as a solution to a particular problem. Does it work the way to want and does it have the performance you expect? Those are the questions only YOU can answer.
In a vb.net 2010 desktop application, I want to use 2 values for rowfilter and sort in a dataset, but I do not know how to accomplish that goal. The 2 values that I want to use for rowfilter and sort are the following: Variables.g_strCatId & CType(sItemEntered, String)
Here is the code that I have so far:
Public Sub FilllstItem2(ByVal sItemEntered As Integer) Dim dtInv As DataTable = dsRpt.Tables("tblItemData") Dim dv As New DataView(dtInv) Dim i As Integer
.RowFilter = "RecordID = '" & Variables.g_strCatId & CType(sItemEntered, String) & "'"
.Sort = "RecordID"
If dv.Count > 0 Then
For i = 0 To dv.Count - 1
lstboxItems.Items.Add(CType(dv.Item(i)("ItemNo"), String) & " - " & CType(dv.Item(i)("Description"), String))
Thus would you show me how to modify the code that I just listed above so that I can pass the 2 values of Variables.g_strCatId & CType(sItemEntered, String) to the rowfilter and sort code that I listed below:
to With dv .RowFilter = "RecordID = '" & Variables.g_strCatId & CType(sItemEntered, String) & "'" .Sort = "RecordID" End With
Is there a way to use a linq statement instead? If so, can you show me the code to use the linq statement?
OK, so you're already passing two variables to the sort filter. You're combining some value of g_strCatId with whatever value is in sItemEntered into a single string and sending that to the RecordId, as a string.
Your resulting filter looks something like this:
RecordId = 'SomeCarId0000123'
Is that what you want?
Without a much better explanation of how this filter is supposed to work and how it should be using the values supplied, there's little anyone can do to help.
I am completely new to vb programming or programming in general! I am a 30 year old want to be programmer but it is so hard for me to understand any languages at all. I tried visual basic many years ago and never got the hang of it at all. This is my first serious attempt at any programming. Well on with my question. I need to make a program that will
1. check to see if device is connected
2. install an .apk file
3. install another .apk file
4. push a folder with preinstalled apps into said directory
I am trying to make a program for my phone. I will be using adb and adb commands. I would like to distribute this with my friends but when I run the program on there computer it says directory not found, then it shows my directory on their computer. Please help so confused
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If Not Directory.Exists("ADB") Then
If Not File.Exists("ADB\adb.exe") Then
If Not File.Exists("ADB\AdbWinApi.dll") Then
If Not File.Exists("ADB\AdbWinUsbApi.dll") Then
If Not File.Exists("ADB\fastboot.exe") Then
If Not Directory.Exists("Addon") Then
If Not File.Exists("Addon\Firestarter.apk") Then
Function adb(ByVal Arguments As String) As String
Dim My_Process As New Process()
Dim My_Process_Info As New ProcessStartInfo()
My_Process_Info.FileName = "cmd.exe"' Process filename
My_Process_Info.Arguments = Arguments ' Process arguments
My_Process_Info.WorkingDirectory = "/c"
My_Process_Info.CreateNoWindow = True
My_Process_Info.UseShellExecute = False
My_Process_Info.RedirectStandardOutput = True ' Redirect (1) Output
My_Process_Info.RedirectStandardError = True ' Redirect non (1) Output
My_Process.EnableRaisingEvents = True
My_Process.StartInfo = My_Process_Info
My_Process.Start() ' Run the process NOW
Dim Process_ErrorOutput As String = My_Process.StandardOutput.ReadToEnd() ' Stores the Error Output (If any)
Dim Process_StandardOutput As String = My_Process.StandardOutput.ReadToEnd() ' Stores the Standard Output (If any)
' Return output by priority
If Process_ErrorOutput IsNot Nothing Then Return Process_ErrorOutput ' Returns the ErrorOutput (if any)
If Process_StandardOutput IsNot Nothing Then Return Process_StandardOutput ' Returns the StandardOutput (if any)
Catch ex As Exception
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
MsgBox(adb("/c adb devices"))
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim sr As New IO.FileStream("", IO.FileMode.Open)
Dim sw As New IO.FileStream("[copyto]", IO.FileMode.Create)
Dim len As Long = sr.Length - 1
Dim buffer(1024) As Byte
Dim bytesread As Integer
While sr.Position < len
bytesread = (sr.Read(buffer, 0, 1024))
sw.Write(buffer, 0, bytesread)
ProgressBar1.Value = CInt(sr.Position / len * 100)
MsgBox(adb("/c adb install Firestarter.apk"))
I'm embarrassed because this is about 4 guys just who have no idea and just winging code together. Only one guy has some and i mean very little experience. Any suggestions help. Trying to figure out how to allow other computer or phone to find the program or have it installed or uploaded to their device if that makes any sense. Thank you so much