that is for defining more information on the topic. to doing that, i have no problem with the coding its just im usually comfortable with database programming but not integrate it with some analysis modelling so this is first for me. i seek tips from you guys on how this process can be done if it is possible or you guys can share other related information it would be great.
Here I Used windows.Datagridview in VB.Net. I need third party tool of datagrid because specify cell focus,enter key to choose from list,Date time picker in Etc......so tell about me Name of cheep and best tool or Free datragrid
Good day friends! I need your help. I and my group have the following task "design and implementation of wireless communication software using visual studio 6.0". The major goal of this app is to send files from one pc(server) to another(client). We created the software using winsock control and tested it in the system and it worked fine. Then we created a ad hoc wireless network then added another pc to this network. We installed the client.exe in the client pc and set the RemoteHost address to the server's IP address. We click on connect on the pc(client). But when we tried to send files from server pc to client pc error always appears saying no active connection. Help please.
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
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
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
PrivateSub Form1_Load(sender AsObject, e As EventArgs) HandlesMyBase.Load
IfNot Directory.Exists("ADB") Then
ElseIfNot File.Exists("ADB\adb.exe") Then
EndIfIfNot File.Exists("ADB\AdbWinApi.dll") Then
EndIfIfNot File.Exists("ADB\AdbWinUsbApi.dll") Then
EndIfIfNot File.Exists("ADB\fastboot.exe") Then
EndIfEndIfIfNot Directory.Exists("Addon") Then
ElseIfNot File.Exists("Addon\Firestarter.apk") Then
EndIfEndIfEndSubFunction adb(ByVal Arguments AsString) AsStringTryDim My_Process AsNew Process()
Dim My_Process_Info AsNew 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 AsString = My_Process.StandardOutput.ReadToEnd() ' Stores the Error Output (If any)
Dim Process_StandardOutput AsString = My_Process.StandardOutput.ReadToEnd() ' Stores the Standard Output (If any)
' Return output by priority
If Process_ErrorOutput IsNotNothingThenReturn Process_ErrorOutput ' Returns the ErrorOutput (if any)
If Process_StandardOutput IsNotNothingThenReturn Process_StandardOutput ' Returns the StandardOutput (if any)
Catch ex As Exception
EndTryReturn"OK"EndFunctionPrivateSub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
MsgBox(adb("/c adb devices"))
EndSubPrivateSub Button2_Click(sender AsObject, e As EventArgs) Handles Button2.Click
Dim sr AsNew IO.FileStream("", IO.FileMode.Open)
Dim sw AsNew IO.FileStream("[copyto]", IO.FileMode.Create)
Dim len AsLong = sr.Length - 1Dim buffer(1024) AsByteDim bytesread AsIntegerWhile 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
That is why it is recommended to create a connection in the method where you need it, and to wrap it in a using-block to ensure disposing. It might sound expensive to create a new connection-object, but it is not. Hunting for these kinds of bugs is however.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
You attempt to execute an INSERT statement which specifies 23 columns, but only inserts 20 values.
That throws the "Number of query values and destination fields are not the same" exception.
Your code then fails to close the connection, so the next time you click the button, you get the "Not allowed to change the 'ConnectionString' property..." exception.
As the others have said, create your connection object inside the method, and wrap it in a Using block[^] to ensure that it is always disposed of properly.
Make sure your INSERT statement has the same number of parameter placeholders in the VALUES part as the number of columns in the INSERT INTO part.
There's no need to convert the Text property to a string, as it's already a string.
You can simplify adding the parameters by using the AddWithValue method.
You should avoid catching the general Exception type. Only catch the exceptions that you want to handle. In this case, System.Data.Common.DbException is the only one you want to catch.
Const ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database3.mdb"
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Const CommandText As String = "INSERT INTO Inquiry_Form([Date], [RefNo], [NameP], [Address], [Age], [PhoneNo], [MobileNo], [EmailAd], [ReferralQuestion], [Type_of_Unit], [Date_of_Purchase], [Purpose_of_Purchase], [Monthly_Income], [RName], [RAddress], [RMobileNo], [R2Name], [R2Address], [RMobileNo], [R2Name], [R2Address], [R2MobileNo], [AgentsName]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
Using connection As New OleDbConnection(ConnectionString)
Using cmd As New OleDbCommand(CommandText, connection)
Catch ex As System.Data.Common.DbException
You should also give your controls meaningful names, rather than accepting the default names created by the designer. You might remember that TextBox11 is the "RAddress" now, but when you come back to this code in a few months, you'll be cursing yourself for leaving the controls with the default names!
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
In an existing vb.net 2010 desktop application, I would need to have 2 users share the same computer. Both users will run the same desktop application but have access to different files and folders on the network share. Each person will have their own unqiue config file to show what files they have access to.
Based upon what I have said, I have the following questions to ask:
1. Will I need separate installs of the application on the same computer? Part of the install process includes placing the app.config file in the correct location. If so, can you tell me what I need to do for the separate installs?
2. If I do not need separate installs, what should I do about the separate app.config files? Each person's config file will point to files they directly have access to. I do not want each person to access the other person's config file.
Will I need separate installs of the application on the same computer?
No, you can get the windows user name and then use that to allow/disallow certain access.
Each person's config file will point to files they directly have access to. I do not want each person to access the other person's config file.
If they are admins on the machine then they can get access to it. Otherwise, if they are not, then you can use the user's app_data folder or something like that. But, it sounds like you may want to encrypt the config file or use a sql database to store what they can access.
There are only 10 types of people in the world, those who understand binary and those who don't.