|
are you sure its an 'FTP' issue - sure its File Transfer, but, is it using FTP protocol (a bit misleading)
Im assuming you've done the obvious checks in the ad-hoc wireless network
a) client and server are on same tcp/ip segment
b) client can ping server
c) server can ping client
if your ad hoc wireless network is on a different tcp/ip'segment' then you're going to have to use a 'switch' and configure it and/or your client to get to the different 'segment' / address
|
|
|
|
|
Hallo Guys,
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
Quote: 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
Enyanga = Day(Now)
Omwosi = Month(Now)
Omwaka = Year(Now)
If Len(Enyanga) = 1 Then
Enyanga = "0" & Enyanga
End If
If Len(Omwosi) = 1 Then
Omwosi = "0" & Omwosi
End If
If Rs.State = 1 Then
Rs.Close
End If
Contp = Omwosi & Omwaka
v_USR_NM = Username
V_ERRR_MSSG = ""
v_Chqno = TxtChqNo.Text
ChqAcNo = TxtAliase.Text
Locator = TxtAcNo.Text
Amount = TxtAmount.Text
V_imageF = TxtFimg.Text
v_imageB = TxtBimg.Text
v_Locator = Locator
v_Amnt_ip = Amount
V_CRRNT_DTNO = Omwaka & Omwosi & Enyanga
TranT = "CHEQCLR"
Call Create_TransactionID
With cmd
.ActiveConnection = ConACExp
.CommandText = "InHseClr_dp"
.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("result", adInteger, adParamOutput)
cmd.Parameters.Append cmd.CreateParameter("ChqAcNo", adVarChar, adParamInput, 30, ChqAcNo)
cmd.Parameters.Append cmd.CreateParameter("v_Locator", adVarChar, adParamInput, 30, v_Locator)
cmd.Parameters.Append cmd.CreateParameter("Chqno", adVarChar, adParamInput, 30, v_Chqno)
cmd.Parameters.Append cmd.CreateParameter("v_Amnt_ip", adVarChar, adParamInput, 30, v_Amnt_ip)
cmd.Parameters.Append cmd.CreateParameter("v_USR_NM", adVarChar, adParamInput, 60, v_USR_NM)
cmd.Parameters.Append cmd.CreateParameter("BcodeUser", adVarChar, adParamInput, 10, BcodeUser)
cmd.Parameters.Append cmd.CreateParameter("CompName", adVarChar, adParamInput, 60, CompName)
cmd.Parameters.Append cmd.CreateParameter("Absid", adVarChar, adParamInput, 60, Absid)
cmd.Parameters.Append cmd.CreateParameter("Contp", adVarChar, adParamInput, 20, Contp)
cmd.Parameters.Append cmd.CreateParameter("V_imageF", adVarChar, adParamInput, 200, V_imageF)
cmd.Parameters.Append cmd.CreateParameter("v_imageB", adVarChar, adParamInput, 200, v_imageB)
cmd.Parameters.Append cmd.CreateParameter("V_CRRNT_DTNO", adChar, adParamInput, 20, V_CRRNT_DTNO)
Set Rs = cmd.Execute
res = cmd("result")
If (res = 1) Then
MsgBox "Updated Successfully"
Else
MsgBox "Error Update unsuccessful.", vbInformation, "No update done"
End If
Set cmd.ActiveConnection = Nothing
End With
'
---Procedure Declaration Part
Quote: PROCEDURE InHseClr_dp
( 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
) IS
-- variables
Bcode varchar2(5);
v_ACCNO varchar2(30);
v_BCODE varchar2(5);
|
|
|
|
|
Just a guess, but since the result parameter is declared as IN OUT , shouldn't the equivalent ADO parameter be created using adParamInputOutput ?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks. Changed as per your observation but getting same error message Sir.
|
|
|
|
|
Check the names of the parameters you are passing in - there are not all the same as the parameter in the stored procedure.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Thanks man, it worked. There was one variable in VB that was not exactly as the one in the Stored Procedure.
|
|
|
|
|
Is the following code correct to load table field data to ComboBox? It is working fine but would like to know whether it is the perfect one.
Public Function cboLoadPlants()
Dim dt As DataTable = DAL.LoadData("SELECT DISTINCT Trim(Company) As [Company] FROM CompaniesTable").Tables(0)
cboCompany.ValueMember = "Company"
cboCompany.DataSource = dt
cboCompany.SelectedIndex = 0
Return True
txtSearch.Select()
End Function
|
|
|
|
|
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.
|
|
|
|
|
hi,
can i create sql query in query builder by selecting sql views instead of selecting sql tables??
please someone help me...!
|
|
|
|
|
What does this have to do with writing code in Visual Basic.NET??
|
|
|
|
|
He wants to Visualize the answer in the most Basic way possible?
|
|
|
|
|
Member 12094561 wrote: can i create sql query in query builder by selecting sql views instead of selecting sql tables?? Yes it is possible, just reference the views as you would reference any table.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
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
With dv
.RowFilter = "RecordID = '" & Variables.g_strCatId & CType(sItemEntered, String) & "'"
.Sort = "RecordID"
End With
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))
Next i
Else
End If
dv.Dispose()
ReDim itemArray(lstboxItems.Items.Count)
End Sub
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.
|
|
|
|
|
You are correct on the value passed to the recordid. I did end up using linq to solve my problem.
|
|
|
|
|
how can i code my software to auto start at windows startup?
|
|
|
|
|
|
That's called a "service application". Windows starts services before users get a chance to log in.
|
|
|
|
|
I can't make my listbox height same as my textbox in a form, how do I resize the listbox as I wanted.
|
|
|
|
|
Try setting the Listbox's IntegralHeight property to False
|
|
|
|
|
I got 'em right now, thanks buddy, you are a big 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
|
|
|
|
|
Member 12079859 wrote: when I run the program on there computer it says directory not found
Can you provide us the line of code that threw this exception, as well as how the variable(s) it is using are declared and assigned?
I never finish anyth
|
|
|
|
|
Imports System.IO
Imports System.Threading
Imports System.Windows.Forms.DialogResult
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If Not Directory.Exists("ADB") Then
Directory.CreateDirectory("ADB")
Else
If Not File.Exists("ADB\adb.exe") Then
File.WriteAllBytes("ADB\adb.exe", My.Resources.adb)
End If
If Not File.Exists("ADB\AdbWinApi.dll") Then
File.WriteAllBytes("ADB\AdbWinApi.dll", My.Resources.AdbWinApi)
End If
If Not File.Exists("ADB\AdbWinUsbApi.dll") Then
File.WriteAllBytes("ADB\AdbWinUsbApi.dll", My.Resources.AdbWinUsbApi)
End If
If Not File.Exists("ADB\fastboot.exe") Then
File.WriteAllBytes("ADB\fastboot.exe", My.Resources.fastboot)
End If
End If
If Not Directory.Exists("Addon") Then
Directory.CreateDirectory("Addon")
Else
If Not File.Exists("Addon\Firestarter.apk") Then
File.WriteAllBytes("Addon\Firestarter.exe", My.Resources.Firestarter)
End If
End If
End Sub
Function adb(ByVal Arguments As String) As String
Try
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
Return ex.Message
End Try
Return "OK"
End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
MsgBox(adb("/c adb devices"))
End Sub
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)
Application.DoEvents()
End While
sw.Flush()
sw.Close()
sr.Close()
MsgBox(adb("/c adb install Firestarter.apk"))
End Sub
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
modified 23-Oct-15 8:10am.
|
|
|
|
|
When you write
If Not Directory.Exists("someDirectoryName") Then
(and ditto for File.Exists ), then you need to pass the full path, not the relative one. You can use
If Not Directory.Exists(Application.StartUpPath & "\someDirectoryName") Then
|
|
|
|
|