|
Hi I actually didnt do anything different than first code block I have shared. I double checked interop .dll and basicly it was there.
|
|
|
|
|
textbox allowing the user to enter more htan one number
|
|
|
|
|
Did you want to describe a problem you're having or ask a question?
What you posted makes no sens and comes across like a fast food order.
|
|
|
|
|
Hi Guys,
How to type into 2 different Textbox at same time ?
Basicly I want to type into textbox1 and it reflects to textbox2 at same time.
Sorry if I couldn't elaborate further since I am new to this.
Thank you.
|
|
|
|
|
Take take TextChanged-Event from TextBox1.
Inside this Handler-Method you write the content of TextBox1 to TextBox2.
|
|
|
|
|
I am sending information between two vb.net applications using named pipes; serializing the information object, sending it to the second app, then deserializing it. All works well, but I am finding that I need to send more than one type of object. However, I cannot tell the type of serialized object that has been received until *after* it has been deserialized.
Is there a method of identifying the object type *before* I deserialize it so I can then cast it into the proper object type when received?
|
|
|
|
|
Perhaps you should what you have done and how you have done it (provide some code) and then we could discuss the possibilities ...
|
|
|
|
|
GetType.ToString, and send that before you send your serialized stuff. How you gonna cast it, is beyond me, I just woke up
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.
|
|
|
|
|
In situations where people jump into sending objects "over the wire" for the first time, especially where noobs start sending images, is that they just go straight for sending the object or image. Well, if you just picked up the phone and dialed a number, the other side answered, and you just said "this image", the person on the other end of the call isn't going to know what you're talking about or what to do with that information. You haven't set up any context for a conversation. You don't have any protocol in place to describe what you're doing.
You have to build your own communication protocol for setting up and maintaining both a conversation and subject context.
The conversation should not start with shoving any old object onto the wire. You have to setup a context for conversation, or what you're going to be talking about. For example, start with "I'm going to send you 'such and such' object. The next x number of bytes will be the data for that object". Obviously, you don't send the full text of what I just posted. You send data that means what is in the quotes. Now you have a context to work with. The receiver will have a better idea of what it's looking at when that data shows up and what to do with it.
Now, you also have to fill in the details for what to do when the receiver either gets too many bytes, or not enough, and other communication failures.
|
|
|
|
|
Gents,
Please I need your help to code the subtotal sum in Textbox for in case you have a client that is buying multiples product with in one bill.
I been trying this for long period.
regards
|
|
|
|
|
Member 14179211 wrote: I been trying this for long period. Trying what? Please edit your question and add some proper detail; you have not explained which framework you are using or what is the structure of the data that you have to create the sum.
|
|
|
|
|
Hi Guys,
How to add 3 IF conditions to below code part ?
else
If txtFullname.Text <> txtFullname.Tag Then
strSQL = _
" SELECT Count(tblContact.Fullname) AS CountFullname FROM tblContact " & _
" WHERE Fullname = " & "'" & txtFullname.Text & "'"
If DuplicateName(strSQL) Then
MessageBox.Show("test.", "warning",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtFullname.Focus()
Exit Sub
End If
End If
|
|
|
|
|
RedPandinus wrote: How to add 3 IF conditions to below code part ? What do you mean, and what conditions are you referring to? You should also learn how to use proper parameterised queries for SQL. Using string concatenation is dangerous.
|
|
|
|
|
Hi Richard,
Let me clarify, I have 3 areas, name, phone and email. program should warn and shouldnt add it to db if name or phone or email is already at db.
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
If txtFullname.Text = "" Or IsNothing(txtFullname.Text) Or txtFullname.Text.Length = 0 Then
MessageBox.Show("test", "Warning",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtFullname.Focus()
Exit Sub
End If
If NewData Then
strSQL = _
" SELECT Count(tblContact.Fullname) AS CountFullname FROM tblContact " & _
" WHERE Fullname = " & "'" & txtFullname.Text & "'"
If DuplicateName(strSQL) Then
MessageBox.Show("Test", "Warning",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtFullname.Focus()
Exit Sub
End If
|
|
|
|
|
As I said above you should start by converting your SQL to proper parameterised queries, not concatenated strings. In your code above what will happen if the user types "MyName'; Drop Table tblContact; --"?
You just need to use a compound WHERE clause as described at SQL AND, OR, NOT Operators[^].
[edit]
Thanks to @RichardDeeming for pointing out my syntax error.
[/edit]
modified 12-Mar-19 4:21am.
|
|
|
|
|
Richard MacCutchan wrote: what will happen if the user types "MyName; Drop Table tblContact; --"?
Not much, since you missed the single quote.
MyName'; Drop Table tblContact; --
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
[snicker]
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
(again)
|
|
|
|
|
One of these days I will really learn SQL syntax. (maybe)
|
|
|
|
|
Here is my code:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
AddHandler send_sms.SerialPort.DataReceived, New SerialDataReceivedEventHandler(AddressOf DataReceived)
Try
With send_sms.SerialPort
rcvdata = ""
send_sms.SerialPort.WriteLine("AT" & vbCrLf) 'is modem okay?
Thread.Sleep(1000)
send_sms.SerialPort.WriteLine("AT+CMGF=1" & vbCrLf) 'To format SMS as a TEXT message
Thread.Sleep(1000)
send_sms.SerialPort.WriteLine("AT+CPMS=""SM""" & vbCrLf) ' Select SIM storage
Threading.Thread.Sleep(1000)
send_sms.SerialPort.WriteLine("AT+CMGL=""REC UNREAD""" & vbCrLf) 'read unread messages
Threading.Thread.Sleep(1000)
send_sms.SerialPort.WriteLine("AT+CMGL=""ALL""" & vbCrLf) 'print all message
Threading.Thread.Sleep(1000)
RichTextBox1.Text = send_sms.SerialPort.ReadBufferSize()
RichTextBox1.Text = send_sms.SerialPort.ReadLine()
' send_sms.SerialPort.ReadLine = RichTextBox1.ToString()
'MsgBox(rcvdata.ToString)
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub test(ByVal indata As String)
rcvdata &= indata
End Sub
__ it only read the status of port says "OK"
please, help me.
|
|
|
|
|
It looks like you only read a single line. You need to keep reading until the entire message is received.
|
|
|
|
|
After every Writeline-Command your wait 1 Second and block the complete System during this time.
I suppose you need a kind of Statemachine for your issue.
Perhaps you explain want you want to have happen ...
|
|
|
|
|
how, can u please teach me? thank you
|
|
|
|
|
At first you have to explain what should happen - for example :
you send : ("AT" & vbCrLf)
- you get back ???
then you send (AT+CMGF=1" & vbCrLf)
- you get back ???
then you send ("AT+CPMS=""SM""" & vbCrLf)
- you get back ???
and so on ...
|
|
|
|
|
i already have code for sending sms I want to read the message in case someone reply. Thank you for the advice..
|
|
|
|