|
Is there not something I can do with pre or post validation. I have not used them but that seems like it could some how work.
Humble Programmer
|
|
|
|
|
Again, that's exposed entirely by the control in question. Validation could work, but how you have to do it is dictated by whoever wrote the control.
|
|
|
|
|
Thank you,
sorry if I have wasted your time.
Humble Programmer
|
|
|
|
|
It's not my time that's wasted. Most people who answer questions regularly here have never used ComponentOne controls. The base of experience on any one third-party control is going to be very low. The best source of information, and the great knowledge base, is going to be the support forums of the manufacturer of the controls.
|
|
|
|
|
I'm doing a project in VB.Net 2003 (I don't think the method and code would really change in Vb.Net 2005) and the client wants to be able to change the database location at any place on his computer. In VB.Net 2003, I'm using the data adapters with datasets, along with a connexion, but my problem is how can I connect the controls to the database and manipulate the data if the location is changed? It's all done with a few lines of code only. Should I forget this method and do it all in code, or maybe someone have a better solution for my problem?
Thanks!
|
|
|
|
|
You connect to the database using a connection string. You can change that string to look for the database in just about any location you want.
|
|
|
|
|
By changing only the connection string, the datasource of my grids will still be ok? I won't even need to change it? Well, thanks a lot!
|
|
|
|
|
|
I have a very weird problem. I'll try to be specific, but I'm just beginning VB.NET programming.
I built a SQL Server 2005 database from the ground up. Currently I'm building a front-end in VB.NET. I'm using a Janus GridEX 2 to make a hierarchy of projects, assemblies, and parts. For some reason, the projects and assemblies update fine, but the parts and "Assemblies to Assemblies" (used to make nearly infinate levels of hierarchy) tables create an error saying it can't update the Id. The Id is required to make the program work, so I can't just remove it.
The first two lines work. The last two do not.
Me.ProjectTableAdapter.Update(Me.ProjPurch2005DataSet.Project)<br />
Me.AssemblyTableAdapter.Update(Me.ProjPurch2005DataSet._Assembly)<br />
Me.Assy2AssyTableAdapter.Update(Me.ProjPurch2005DataSet.Assy2Assy)<br />
Me.PurchaseTableAdapter.Update(Me.ProjPurch2005DataSet.Purchase)
Is there a blatent reason that I'm just not seeing?
|
|
|
|
|
`Drew wrote: create an error saying it can't update the Id.
The Data and Table adapter require that the table's they are working on have primary keys. If your table doesn't have one, you can't do any updating of the tables until you put one in and update the DataAdpter or TableAdapter SQL statements to return that key field in the query results.
...or did I miss something in your post??
|
|
|
|
|
Is an IDENTITY column the same as a primary key?
|
|
|
|
|
Nope. Far from it. Read[^]
|
|
|
|
|
In my application I have a process that can take quite a bit of time to run (so I have it in it's own thread so I can display progress to the user). In the event that a 2nd process starts I need to pause the thread, then restart it once the 2nd process is complete. When I use Thread.Resume to restatt it it displays a warning
Public Sub Resume()' is obsolete: 'Thread.Resume has been deprecated.
Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.
What are the acceptable replacements for .Resume as I have Google'd it and cant find the answer
"It's only that urgent if you have to pee."
Dave Kreskowiak
|
|
|
|
|
Psycho-*Coder*-Extreme wrote: I need to pause the thread, then restart it once the 2nd process is complete
How did you "pause" this thread?? I hope you didn't call Abort() on it. Once a thread is stopped, that's it, you can't restart it. You have to destroy it and create another one.
Your thread should be checking for a flag set by your main thread to tell it to "pause". Once the 2nd process completes, you can reset this flag telling your first thread to resume.
|
|
|
|
|
For pausing it I use
'Put the thread to sleep for as long as I need it
Thread.Sleep(System.Threading.Timeout.Infinite)
'Set the flag
bIsPaused = True
Then to resume it I use
'Check the status of the thread
If thrdAgentStatus.ThreadState And ThreadState.Unstarted <> 0 And Not bIsPaused Then
thrdAgentStatus.Start()
Else
thrdAgentStatus.Resume()
End If
My problem is that the .Resume gives a warning that it is depreciated and I was trying to find an alternative so I can get rid of this warning.
"Okay, I give up: which is NOT a real programming language????"
Michael Bergman
|
|
|
|
|
Psycho-*Coder*-Extreme wrote: 'Put the thread to sleep for as long as I need itThread.Sleep(System.Threading.Timeout.Infinite)'Set the flagbIsPaused = True
OK. That's not going to work. The flag is never set because the thread sleeps, or Blocks, immediately. Start and Resume will not "wake up" a blocked thread. You have to call the Thread object's Interrupt method to unblock a blocked thread.
Dim oThread As System.Threading.Thread
oThread = New Thread(AddressOf Me.Fill)
oThread.Start()
oThread.Sleep(System.Threading.Timeout.Infinite)
Dim retValue As MsgBoxResult = MsgBox("Wake Thread?")
If retValue = MsgBoxResult.Yes Then
oThread.Interrupt()
End If
|
|
|
|
|
Hi, I'll try to make this as brief as possible.
I have an app that references SAE standard DLLs (RP1210a in case anyone cares) to communicate with external devices. Many different vendors supply these DLLs with their hardware. My app needs to be able to reference any of these depending on which one the end user is using.
My problem is I cannot declare Functions to each DLL because I get the "Multiple definitions with identical signatures" error.
example,
Declare Function RP1210_ClientConnect Lib "DG121032" (ByVal hwndClient As Short, ByVal nDevice As Short, ByVal fpchProtocol As String, ByVal lTxBufferSize As Integer, ByVal lRcvBufferSize As Integer, ByVal nIsAppPacketizingIncomingMsgs As Short) As Short
and
Declare Function RP1210_ClientConnect Lib "NXULNK32" (ByVal hwndClient As Short, ByVal nDevice As Short, ByVal fpchProtocol As String, ByVal lTxBufferSize As Integer, ByVal lRcvBufferSize As Integer, ByVal nIsAppPacketizingIncomingMsgs As Short) As Short
Hopefully this makes sense, and any help would be GREATLY appreciated.
|
|
|
|
|
You can't name a function the same as another unless you are doing an override or overload of the function. If you want to make a function that will in turn call the DLL function, name it something different.
|
|
|
|
|
A co-worker suggested I need to use System.Reflection.Assembly to solve this problem. Any experience with this?
|
|
|
|
|
No, I don't recall ever using the System.Reflection.Assembly namespace. And I think I misunderstood your first question. I was thinking that the DLLs were .Net and you were just trying to use them...but now I understand that you were trying to define non-.Net DLL methods them so that you could call them. This is something that I've never had to do. Sorry I couldn't help you.
|
|
|
|
|
Hey, no problem. I really appreciate the help anyway!
You are correct, I am trying to define methods in non .net DLLs. If I find a solution I will post back in case anyone else runs into this.
Otherwise, anyone else have a solution?
|
|
|
|
|
I am working on a program that communicates with a device using a Rs232 serial cable. I have to send data packets to it. I have never dealt with data packets. I assume they are not strings? Can you suggest some articles I can read up on. OR give me some code that I can reference.
EX: I need to send this. How would I send this?
<0x02>PSWD<0x01>Passwort<0x03><0x1F><0x7F>
|
|
|
|
|
A packet is just nomenclature for a defined block of data, usually with a header - payload - trailer structure. The exact layout is protocol specific, so in this case it sounds like you have carte blanche.
Typically however the header will be structured so that it is easily identifiable as such.
If the packets are not fixed in length then it will typically contain the size of the payload (since both header and trailer are usually fixed length this is also sufficient to figure out the size of the packet).
Also the header will typically contain the destination and source addresses. Not an issue with RS232!
The payload is whatever needs to be communicated.
The trailer usually contains a checksum of the packet for error correction.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
You're going to have to build a string to send. There's a bunch of ways to do it, but this works in a short example:
Dim passwordCommand As String = Chr(&H2) & "PSWD" & Chr(&H1) & "{0}" & Chr(&H3) & Chr(&H1F) & Chr(&H7F)
Dim setPasswordCommand As String = String.Format(passwordCommand, "MyPassword")
You then send the string contained in setPasswordCommand to the COM port you opened using the SerialPort class (.NET Framework 2.0 and above only).
|
|
|
|
|
Here is my code.
When I send a string SERIELL. The device is suppose to send back a confirmation string 'OK'. When I do a MessageBox.Show(serialPort.ReadChar) I get two message boxes one with 79 one with 75. These are UNICODE for 'O' and 'K'. GOOD
But when I send this for a password I am suppose to get ACK or 0x06 back and I only get a 21 back. Do I need to send in UNICODE? Binary? Hex? What are your thoughts? The original code was ANSI-C or C#.
Dim passwordCommand As String = Chr(&H2) & Chr(&H50) & Chr(&H53) & Chr(&H57) & Chr(&H44) & Chr(&H1) & Chr(&H50) & Chr(&H61) & Chr(&H73) & Chr(&H73) & Chr(&H77) & Chr(&H6F) & Chr(&H72) & Chr(&H74) & Chr(&H3) & Chr(&H1F) & Chr(&HF7)
|
|
|
|