|
Do you need an @ in front of Date ?
|
|
|
|
|
Stupid, Stupid, Stupid me.
I can't believe I worked for hours on this and it turns out to be a data error.
"12:00" verses "12:00:00"
Thanks to a test program I found, XPath Visualizer, I found the
problem immediately
Sorry for my Stupidness
Thanks
-- modified 12-Nov-18 6:58am.
|
|
|
|
|
Public Sub incrPR()
Dim curValue As Integer
Dim result As String
Dim s As String = "PR"
Dim yr As String = Now.Year.ToString()
Using con As SqlConnection = New SqlConnection(ConString)
con.Open()
Dim cmd = New SqlCommand("Select MAX(SpecialOrderNo) FROM SpecialOrder", con)
result = cmd.ExecuteScalar().ToString()
cmd.Parameters.Clear()
If String.IsNullOrEmpty(result) Then
result = "PR000"
End If
result = result.Substring(3)
Int32.TryParse(result, curValue)
curValue = curValue + 1
result = s + curValue.ToString("D3")
txtno.Text = result
End Using
End Sub
|
|
|
|
|
curValue is the number (if I read that right), so you just need to construct your string from that followed by the year followed by "PR". Each field separated by the '-' character. What is the problem with doing that?
|
|
|
|
|
allukasan wrote:
You don't.
You divide them over the three atomic fields that they are, and put them together only when being formatted for viewing. That way "001" is a simple autoincrement, the other two are simply added to it.
The "Id" that you are assigning to it should also not be used as a key.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I want calculate chord in midi with vb6
Can you help me?
thanks
|
|
|
|
|
Nope. You have to define exactly what you mean by "calculate chord in midi".
And VB6 has long been dead. You have absolutely no reason for using on on new projects. The Community edition of Visual Studio is free from here[^]. It supports VB.NET, C#, C/C++, ...
|
|
|
|
|
|
Hello all.
I am using the FMOD libraries to perform a spectrum analyzer, the results of the call to the library store in the array 'Spectrum ()' type 'Single', later these are passed to the array 'InSpect ()' type 'Integer '
The problem I have in the conversion of 'Single to Integer' gives overflow error, once I examine the data in the array 'InSpect ()' I have nothing are empty, while in the array 'Spectrum ()' are all the data, I have not yet found such an error or failure.
Let's see if you can help me, Thanks.
The code is following (summarized):
Dim Spectrum(1023) As Single
Dim InSpect(1023) As Integer
Dim i as Long
Dim DetSpectro As Long
Call FMOD_System_GetSpectrum(system, Spectrum(0), 512, count, FMOD_DSP_FFT_WINDOW_TRIANGLE)
DetSpectro = system
CopyMemory = Spectrum(0), ByVal DetSpectro , 1024 * 4
For i = 1 To 1023 Step 1
InSpect(i) = Spectrum(i)
Next
THX.
|
|
|
|
|
That means the Single value represents a number that is larger than the largest Integer value. You may need to use the Long type instead.
|
|
|
|
|
Hello,
But the conversion would have to do it automatically when I declare the array type Integer.
THX
|
|
|
|
|
That is irrelevant. If the floating point number represents a value greater than 2147483647, then you will get an overflow error. you need to inspect your data values to see why it is happening; we cannot do that.
|
|
|
|
|
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
provider = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
dataFile = "C:\Users\achikanya\Desktop\xray database.accdb"
connString = provider & dataFile
myConnection.ConnectionString = connString
myConnection.Open()
Dim str As String
str = "Insert into Patient Details([National ID],[First Name],[Last Name],[Phone number],[Email],[Procedure],[Gender],[Address],[Date]) Values (?????????))"
Dim cmd As OleDbCommand = New OleDbCommand(str, myConnection)
cmd.Parameters.Add(New OleDbParameter("National ID", CType(TextBox1.Text, String)))
cmd.Parameters.Add(New OleDbParameter("First Name", CType(TextBox2.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Last Name", CType(TextBox3.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Phone number", CType(TextBox4.Text, String)))
cmd.Parameters.Add(New OleDbParameter("(Email", CType(TextBox5.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Procedure", CType(TextBox6.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Gender", CType(TextBox7.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Address", CType(TextBox8.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Date", CType(TextBox9.Text, String)))
|
|
|
|
|
You're missing commas between the parameter placeholders, and you've got an extra closing bracket at the end of the statement:
str = "Insert into Patient Details([National ID],[First Name],[Last Name],[Phone number],[Email],[Procedure],[Gender],[Address],[Date]) Values (?, ?, ?, ?, ?, ?, ?, ?, ?)"
There's also no need to CType the Text properties as String , since they're already String s.
cmd.Parameters.Add(New OleDbParameter("National ID", TextBox1.Text))
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
In addition to Richard D's comments, you have an open parenthesis character before "Email" in the following:
cmd.Parameters.Add(New OleDbParameter("(Email", CType(TextBox5.Text, String)))
|
|
|
|
|
hola buenas tardes:
espero puedan ayudarme con la siguiente duda, tengo conexion a un lector de huella iface 302
el cual necesito extraer (al momento de checar, el id y nombre del usuario )
alguna sugerencia
esto en el evento onattransction.
Dim enrollnumber As String
If CZKEM1.ReadAllUserID(CInt(MachineNumber)) Then
GetUserTmpExStr MachineNumber, dwenrollnumber, dwFingerIndex, iFlag, tmpData, tmpLength
dwEnrollNumber1 = dwEnrollNmber
dwEnrollNumber1 = EnrollNmber
'Wend
End If
Text4.Text = UserID
Text1.Text = EnrollNmber
Else
'MsgBox "Verify Fail"
End If
no logro ..ayuda.
|
|
|
|
|
|
using vb.net windows form to create custom error message box
modified 9-Oct-18 10:41am.
|
|
|
|
|
What is your user interface web, winforms, WPF. They are all very different.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I did this once with an array in the tag. on the form activate I read the array and returned on the click the dialog result
another way is create propertys
Private _buttonPushed As Integer
Private _buttonarray(,) As Integer
Public WriteOnly Property buttons(buttonarray(,) As String)
Set(value)
buttonarray = buttonarray
End Set
End Property
Public ReadOnly Property Result() As Integer
Get
Return _buttonPushed
End Get
End Property
ButtonArray contains in this case Texts and values
|
|
|
|
|
Hi all,
I am a very beginner in programming, myself learned something out of curiosity from internet.
After more than a year work, I had developed a program in vb 2010 express for the data entry of my patients details in my clinic. Now I need to do something to add the contact details of patient to my google contacts. Currently I am saving the details to an excel sheet and importing it to google manually. After searching in the internet, I had read it needs API and its not free to use also. I had never worked with API and is thinking of a free option. Any one can help me in this matter? Thanks in advance.
|
|
|
|
|
|
Thanks for the reply. Will check it out.
|
|
|
|
|
Could someone tell me how to create a random access file in visual basic.net? I know how to do it in vb6 but I think it is different in vb.net Any help would be appreciated.
Jeff
|
|
|
|
|
|