|
nhsal69 wrote: I'm diverse
which is good.
Now reading a book on VB.NET would give you more depth on .NET programming.
|
|
|
|
|
Andy Murray does.
|
|
|
|
|
Luc Pattyn wrote: Andy Murray does.
Yeah, he is renowned for his ability to code while serving.. all that shouting between points is critic of his SQL and systemfileinfo coding
I need to listen more closely next game to get hints and tips...
|
|
|
|
|
I now have a piece of code which scans a folder and reset the file names to the exact date and time the file was created..
The only problem is I need the modified time (these are all photos, and the modified time is the time the photo was taken) ever other time stamp has been changed when the files were copied from camera to phone etc.
So FileInfo gives you:
CreationTime
LastAccessTime
LastWriteTime
as well as various other bits and bobs, but no Modified time.
I can see it in the jpg files properties, so it must be getabe??
Any ideas??
|
|
|
|
|
LastWriteTime IS the "Last Modified Time" in NTFS.
If you're talking about getting a time out of the metadata in the picture file itself, then these methods will do nothing for you. You need to get the properties out of the JPG. Google for "jpeg metadata vb.net[^]".
|
|
|
|
|
Dear All,
I'm using a HCL Thin Client for run my vb application. I'm getting data through com port which is in thin client. The problem is when I run the application on my thin client it's saying that "The COM port is not ready or busy" (I checked the com port with Hyper Terminal, it's working fine and receiving data). Pls comment on this how to get data from com port on thin client.
|
|
|
|
|
Can we see the code you are using to intregate the COM port?
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Actualy I don't have the source code. It's developed by third party. But according to them the software is working fine in a PC environment( VB6 also installed on that PC)
|
|
|
|
|
Is the application code being run on the thin client or is it being run on the server and the interface just shows up on the thin client?
In the first option, you've got a problem. Since only one copy of the application copy have the serial port at any one time (depending on the server of course!) the first application to get it may work perfectly, and all others will fail.
The second option depends on the configuration of the think client. I also love the little statement on their website that says "the look and feel of working on a Windows environment". That really doesn't instill confidence in which and what type of apps can work.
Your best source of information for this problem is going to be HCL.
|
|
|
|
|
This application is running on Thin Client and sending the information to the server which is located the database. And further I wanna know is that possibility to install VB6 on Thin Client.
|
|
|
|
|
Again, your best source of information is the manufacturer of the machine.
I have no experience with these machines and I seriously doubt anyone else who answers questions around here on a regular basis does either.
|
|
|
|
|
Hi I need help on a function where once the button is clicked, it will then send a signal to the sensor so that when there is an object in the way then the program will read it and count each time there is an object. I have managed to communicate with the parallel port. However I am stuck on creating a loop.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Do
Out(PortAddress, Value)
Value = 8 'The Port it is written to
TextBox2.Text = CStr(Inp(PortAddress))'Read back and display the result.
TextBox1.Text = 1
Loop Until TextBox1.Text = 10
End Sub
|
|
|
|
|
Easily done if you move the sensor code to a seperate thread so you don't block the UI thread. Read up on "Background Worker class". BTW: Using the Parallel port will force you to constantly "poll" the port to see if there is anything there. There exists the chance that the sensor will detect and then not detect the object in between iterations of your polling loop or while the thread is suspended to allow other threads in the system to run. In other words, you'll miss the object.
Using the parallel port is not recommended for production work. It's OK for hobbiest work, but for a production environment, dedicated hardware specifically designed for the detection task would be a better choice and probably come with a better API that you don't have to kludge together.
|
|
|
|
|
Why Dave, he is counting nuts (well, that is the goal anyway). I don't think a fistful of nuts is going to outpace a modern PC, even when interfacing through the parallel port. I had earlier conversations with the guy and learned there is a hardware team and a software team for this, and a motor is involved (not sure how). Before you ask, he's on the software team.
|
|
|
|
|
Luc Pattyn wrote: I don't think a fistful of nuts is going to outpace a modern PC,
No, but the nut passing through the switch fast enough can make/break the connection faster than the poll can get the pin value. Of course, that's entirely dependant on production line speed and where/how the switch is placed. On top of that, what if two nuts are touching each other as they go through the switch? How many nuts went through the switch at once? Is his code going to account for the fact that it takes a variable amount of time for the nut to pass through the switch?
On top of that, why base the entire solution on a port that's dead and doesn't even come on PC's anymore? How long is this solution going to be used? Is there a spare parts plan in place to account for the dwindling supply of parallel port hardware over the life of the project?
I know, I'm nit-picking! But, having some manufacturing experience, I can't help but to think of these things because I've seen what can happen in the event of a detection failure. It can be deadly at one extreme and hillarious at the other!
|
|
|
|
|
I would guess the motor is there to power some gating mechanism that is assumed to let pass one nut at a time, some kind of revolving door (I think the French would call it a "tourniquet", not sure that is an English word though) but I wasn't presented any such information, so I can't be sure.
My very first response was to not use a parallel port, and to be careful about connecting anything to a port (voltages, currents, etc) but then he replied the hardware had been finalized and they now started looking to the software side. I do remember having seen lots of projects going awfully wrong when handled sequentially like that.
|
|
|
|
|
Luc Pattyn wrote: I do remember having seen lots of projects going awfully wrong when handled sequentially like that.
So have I. Ever been in an automotive prototype plant? It's pretty cool watching a paint robot paint itself and completely miss the body it's supposed to be painting!
|
|
|
|
|
How about two robots painting each other? Inspired by Escher[^]?
|
|
|
|
|
I am getting the error "Invalid column name" when i try to insert data into SQL Server Express 2008. I only get the error for the fields I put letters in. I don't get the error for the numeric fields. When I enter numbers in all of the fields the data import works fine so I know the column names are correct. The data type is set to VARCHAR for all of the columns so the field should accept letters also. I don't know what the problem is. Here is my code:
Dim myConnection As New SqlClient.SqlConnection
myConnection.ConnectionString = "Data Source=S10615-10\SQLEXPRESS;Initial Catalog=Assessment;Integrated Security=SSPI;"
Dim myCommand As SqlClient.SqlCommand
Dim strSQL As String
myConnection.Open()
strSQL = "INSERT INTO AssessmentPage1 (ClientName, DOB, MedicalRecords, MedicaidNumber, ConsumersName, MedicaidNumber1, ConsumersID, Clinicians, ParentsName, Address, Clinicians1, PhoneNumbers, DateofReferral, DateofAssessment, SchoolName, IdentifyingInformation, PresentingProblems, ReferralInformation) VALUES(" & TextBox1.Text & "," & TextBox2.Text & "," & TextBox3.Text & "," & TextBox4.Text & "," & TextBox5.Text & "," & TextBox6.Text & "," & TextBox7.Text & "," & TextBox8.Text & "," & TextBox9.Text & "," & TextBox10.Text & "," & TextBox11.Text & "," & TextBox12.Text & "," & TextBox13.Text & "," & TextBox14.Text & "," & TextBox15.Text & "," & TextBox16.Text & "," & TextBox17.Text & "," & TextBox18.Text & ")"
myCommand = New SqlClient.SqlCommand(strSQL, myConnection)
myCommand.ExecuteNonQuery()
myConnection.Close()
myCommand.Dispose()
myConnection.Dispose()
Any ideas would help. Im stuck in the mud here.
|
|
|
|
|
First, we, again, emplore you to drop the string concatentation technique and USE PARAMETERIZED QUERIES instead?
Why? Because you never would have run into this problem if you did.
The SqlParameter class would have properly formatted your data for each field. You're not enclosing the strings you are sending to the VarChar fields in your database in quotation marks, as required by SQL.
Your SQL has to look like this:
INSERT INTO myTable (someTextField) VALUES ("myStringData")
Your code is building the SQL statement like this, which doesn't work:
INSERT INTO myTable (someTextField) VALUES (myStringData)
Notice, the quote marks are missing. This is the problem you are running into.
Since you are also making the huge mistake of using text directly from TextBoxes and not validating any of it, you are opening yourself up to SQL Injection attacks as well as letting users put bad/unnormalized data into every field of your table.
|
|
|
|
|
This is exactly the same as the question you posted under the title "Incorrect syntax".
Posting the same question multiple times is generally frowned on here, especially when the question has already been answered.
|
|
|
|
|
Hi !
First, sorry for my bad english, but I'm french.
I try to understand how making a small "code editor" with a richTextBox and I'm currently working on the "line numbers column". I'm using a Panel and GDI for drawing the column and the numbers too because I want drawing them at the same height of the richTextBox line. I can draw them without problem, except when I st my RichTextBox "WordWrap" property at True.
When a line is too many long, she's "splited". I'm using "GetLineFromCharIndex(rtb.SelectionStart)" on "SelectionChanged". So, for example If Ihave 2 real lines, but the first is to many long. So I have 3 lines now.
When I click on the second part of the first line, this return "1" because for the RichTExtBox, the second part is a new Line.
But I want this return "0" ... I'm on the first "real line", not on the second one.
Is there a way to know when a line is splitted when WordWrap is True ?
|
|
|
|
|
I don't believe there is any way to get notified when one line is wrapped: I don't see an event that would report on it.
The easiest course would probably be to keep WordWrap off, and use a horizonal scrollbar; this is what Visual Studio does. The other alternative would be to build a custom RTF text box from scratch and raise an event when a wrap occurs.
|
|
|
|
|
If you really had to you could do something like
RichTextBox1.SuspendLayout()
RichTextBox1.WordWrap = false
RichTextBox1.GetLineFromCharIndex(rtb.SelectionStart)
RichTextBox1.WordWrap = true
RichTextBox1.ResumeLayout()
though it seems more like a work around...since GetLineFromCharIndex is really just supposed to tell you what line on the display the char is on, not the line in the text.
|
|
|
|
|
Hi William.
Thanks for your trick. This is no really my problem, but your piece of code will be usefull
My richTextBow is already in WordWrap = False. My problem is if the user write an hml Tag like this
<!-- GOOD -->
<div id="myID" class="myclass" />
<!-- False -->
<div id="myId"
class="myClass" />
Yes I could only check for start "<div" after="" the="" attributes="" and="" alone="" end="" tag="" "="">", but I don't think it's the best choice.
|
|
|
|
|