RTrim Giving Different Results?
May 1, 2012contractText = RTrim(reportData.contract)
If contractText = "" Then
[code].....
However if reportData.contract = "" then the code returns recordHasContract = True
contractText = RTrim(reportData.contract)
If contractText = "" Then
[code].....
However if reportData.contract = "" then the code returns recordHasContract = True
The following sql call works fine, returns the correct total retail for customers:
SELECT customer.id,
customer.first_name,
customer.last_name,
[Code].....
How do I go about truncating last character off of a string. I have a page where associates enter in their bank routing number which is a 9 digit number, but I want to trunctate the last digit of the string before passing it to my SQL table. I have a Private sub I use to pass that data into my SQL Table, so I was thinking I would somehow use the RTrim or STRLen function where I am passing Routing Number below.
[Code]....
I have a form that allows users to select file and then it reads the contents, parses the data and then executes a sql insert statement to add it to a database. What I am having issues with is showing real-time results. Currently, I have the import operation take place on the import form within the OnLoad event. The problem with this is it only shows the final results instead of the results real-time. Is there anyway to do this without creating a seperate thread and delegates?
View 1 RepliesHow can I make this program not to give me the results for the quit command input of -999 but rather just to quit without the results?
Sub Main()
Dim TempIncelsius As Double
Dim TempInput As Double
Dim Formula As Double
[CODE]...
I'm using express edition and I am creating a direct IP connector for a game. I have figured out how to do this in the command console by going to the path of the exe e.g cd desktopgamehd2.exe -cmd -join The Ip Here -port Port Here Now I have used the command;
Code:
Dim returnValue As Process
returnValue = Process.Start(readValue)
to launch the game.(The readvalue is a string that reads the location from the games registry entry)Is there anything I can add on to use the direct IP conect command or is a whole diferent piece of code all together?
how do i set a default value in a recordset? i want the value in row 1 to be taken as the default, how do i do this?
i have this error:
Error 1 Class 'System.Data.DataTable' cannot be indexed because it has no default property. C:Documents and Settingsmiller_aDesktopFront End FCOMOctobaseOctobasefrmFrontEnd.vb 41 25 Octobase
refering to this line of code:
booIFP_KG = Availability("KG_IFP")
'booIFP_KG is a checkbox in the datatable availability and kg_ifp is another datatable.
If you're not living on the edge, you're taking up too much room.
A few weeks ago I found out that you can give value types etc.. your own name. Something like:Imports Int32 = MyInt..But I forgot how to do it.
View 7 RepliesI have to use some calculations now and then and sometimes those will give me inf, and sometimes they work, this makes my app very inaccurate...Now i dont know what is causing this, im not dividing zero so far i can see..
(3 + Math.Sqrt(5)) ^ ...
It works for single numbers, But how would i retrieve the ?double? of bigger numbers without getting INF?With bigger numbers i mean really big, like 1477014138.
how do i give a string a dynamic name i.e. in the below for loop i want to create a string name using the item in question.
For i = 1 To NumNames
Dim userName & i.tostring As String
....
Next
Image shows the buttons on my UI in vb.net.All these buttons are having background images. Now what i want is these buttons be shown as inactive when actions corresponding to them are not available so I am making them cmd.enable = false but still on UI there is no visual effect of this disabling them on these buttons. They keep looking same as in enabled mode. So how to give effect of disabled state to these buttons.In the same way i want effect to be visible when mouse is hovered over these buttons and buttons are clicked
View 1 RepliesI am entering a values into another textbox and I want it to surrender Focus to another textbox if the value I have entered is the same as the one in the database.However what is happening is that if the value is the same as in the database the cursor just disappears and it does not give focus to the control that I want it to give focus to. Any ideas on how I can correct this.
Private Sub txtProducedAt_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtProducedAt.TextChanged
Dim iSql As String = "SELECT ID,SiteName FROM Sites WHERE SiteName = '" & txtProducedAt.Text & "' "
Dim da As New OleDbDataAdapter(iSql, LoginForm1.Conn)
Dim dTable As DataTable = New DataTable
da.Fill(dTable)
If dTable.Rows.Count = 0 Then
Exit Sub
ElseIf dTable.Rows.Count > 0 Then
txtProducedAt.Text = dTable.Rows(0)("SiteName").ToString
txtAccountNumber.Select()
End If
End Sub
I've tried putting code into the tabindex changed event but its not doing what i want and also in the lostfocus event
Private Sub txtProducedAt_TabIndexChanged(sender As Object, e As System.EventArgs) Handles txtProducedAt.TabIndexChanged
Dim iSql As String = "SELECT ID,SiteName FROM Sites WHERE SiteName = '" & txtProducedAt.Text & "' "
Dim da As New OleDbDataAdapter(iSql, LoginForm1.Conn)
Dim dTable As DataTable = New DataTable
da.Fill(dTable)
If dTable.Rows.Count = 0 Then
Exit Sub
ElseIf dTable.Rows.Count > 0 Then
txtAccountNumber.Focus()
End If
End Sub
I am entering avalues into another text box and I want it to surrender Focus to another textbox if the value I have entered is the same as the one in the database.However what is happening is that if the value is the same as in the database the cursor just disappears and it does not give focus to the control that I want it to give focus to.
Private Sub txtProducedAt_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtProducedAt.TextChanged
Dim iSql As String = "SELECT ID,SiteName FROM Sites WHERE SiteName = '" & txtProducedAt.Text & "' "
Dim da As New OleDbDataAdapter(iSql, LoginForm1.Conn)
[code]....
I did a calculator program in vb.net,in which the input can be given through mouse.I don't know how to enter it through keyboard.
View 2 RepliesI am busy with a colledge project and need to take pictures and assign values to them.None of my books or any of the searches I have done has even pointed me in the right direction.
View 4 RepliesHere's the function I'm a bit mystified by(Little rusty bitwise operators)
void two_one(unsigned char *in,int in_len,unsigned char *out)
{
unsigned char tmpc;
int i;
[CODE]...
I marked the two places that I don't quite understand. How to convert those pieces to Vb.Net.
Update: So this is what I came up with, but it's not quite giving me back the right data...Anything look wrong here?
Public Function TwoOne(ByVal inp As String) As String
Dim temp As New StringBuilder()
Dim tempc As Char
[code].......
I am trying to connect to a remote machine through a vb.net application and want to retrieve the system information using WMI Classes. But the source line (scope.Connect()) as below generates an error "Access Denied HRESULT...." [code]
View 5 RepliesI have a text box where i am entering numbers of double datatype andon the Keytdown event of the textbox some checks take pace and in certain circumstances I want to be able to stop the user from entering other information until they enter the right information in the textbox (where it says right here) . now when I say exit sub the textbox somehow loses focus . but this is not how I want it to be I want the textbox to remain with the focus so the user can change the information . How can i go about this.
And the other thing is why is my txtDestPayRate1.Focus() just befor the exit sub not working? because I am giving focus to it so whats happening or rather why is it not happening Is there a way other than exit sub to tell it to stop executing on that line and do other stuff
Private Sub txtDestPayRate1_KeyDown1(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles txtDestPayRate1.KeyDown
If e.KeyCode = Keys.Enter Then
[code].....
The following code was taken from a javascript script. What it's (supposedly) doing is assigning properties to the line item. A name, a relations array, rounds array (which they lost in), total wins, three tiebreaker scores, and if they had a bye. (This is for a swiss pairing algorithm.)[code]I want to do something like this in Visual Basic. I'm pulling data from a table using a OleDBReader. I want to give each item that is pulled a set of these properties. Then by some means changing them.
View 1 RepliesHow to select Row by givieing cell value in datagridview
View 5 RepliesI just finished putting the first 6 datagrid controls on my form and i went to go test it and got this build error: Error 4 Value of type 'String' cannot be converted to 'System. Windows.Forms.DataGridViewTextBoxColumn'.C:SoftwareForm1.vb 1425 19..When the line generating the error is this Me.Name = "Form1".where it has the "Form1" portion underlined in blue.This is a weird error because that line was made by the IDE to say the name of the form and has nothing to do with 'System.Windows.Forms.DataGridViewTextBoxColumn'.I tried saving my progress and restarting the IDE with no luck..Now I cannot even access the form in designer mode,One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.The designer cannot process the code at line 1424: Me.Name = "Form1" The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified.
View 5 RepliesI have the following code:
Dim compiler As ICodeCompiler = New Microsoft.JScript.JScriptCodeProvider().CreateCompiler
Dim params As New CompilerParameters
params.GenerateInMemory = True
[code].....
i am facing prob. in listbox the prob. is i am using this code
For i = 0 To ListBox7.Items.Count - 1
ToolStripStatusLabel1.Text = "Current URL: "
ToolStripStatusLabel2.Text = ListBox7.Items(i)
ListBox6.Items.Add(prs.ReturnPageRank(ListBox7.Items(i)))
Next
[Code]...
I've got this code to get the decimal and groupseparator settings on a computer:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim NumFormat As New System.Globalization.NumberFormatInfo
[Code]....
The problem is that on my computer NumberDecimalSeparator should return "," and NumberGroupSeparator should return ".", but it's just the other way around when I try to get both separators from my system. What could be going wrong, and even more important, how to get the right strings? I did check my locale setting to make sure I'm not crazy and I also didn't switch the textboxes.
I'm currently creating a maths game for primary school children and have questions based on addition, subtraction, division and multiplication.I tried it out yesterday and if I type in the correct answer, I get told it's wrong, but if I type in the in the number I'm dividing by, as the answer it comes up as correct. How do I change this so that the correct answer is actually the correct answer?
View 2 Repliesi have old program which is create in vb.5 i have in my PC vb.6 but when i want run program is give me a lot of error , i understand that i miss some .OCX i have this control or reference in my program 1- function MyScan(FpLibXCapture1 As FpLibXCapture, txtID As Object, LabelMessage As Label, LabelAlarm As Variant, Optional txtName As Object) Dim FpLibXVerify1 As FpLibXVerify Dim result As Boolean
View 2 RepliesTextBox1.Text = Format(dtlist.Compute("Min([" & Form10.lp_txt.Text & "])", ""), "#,###")
Its just giving me #,###
ive been building a app, and have a beta tester who is on xp, im on vista x64, the app works great t my end, an dive also tested it on another pc with vista x64, and on a laptop wit win7 32, Now my beta teste has been testing fine on hes xp rig, up untill today when the WIP build i sent him started kicking up errors all over the place, try as i might i cant narrow it down to were the error is, heres how the app looks on vista and win7:[code]So i thought it might of been something i changed in between the working xp version and the wip but, all i changed was the page title, nothing else, no code etc.
View 4 RepliesWhen I use this code:
Dim dloadurl As Uri
Dim saveto As String
Public Sub dodownload()
Try
[code]....
All these buttons are having background images. Now what i want is these buttons be shown as inactive when actions corresponding to them are not available so I am making them cmd.enable = false but still on UI there is no visual effect of this disabling them on these buttons.
View 2 Replies