|
getdate() is a function inside SQL Server that returns the current date/time on the server.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have a search dialog form with a text box where the user enters the search terms and a button which executes the search. The text box traps the keyup event so that the user can just press enter and initiate the search instead of clicking on the button. When the search does not return any results, a message box pops up informing the user. The problem is that if the user clears the message box by pressing enter instead of clicking the OK button, the text box gets the keyup event again, performs the search again, puts up the message box... I was able to avoid this by disabling the textbox before showing the message box and then reenabling it after but this moves the focus to the next control. Moving the focus back to the text box (in code) causes the same behavior. Does anyone know of another way to fix this?
Joe
|
|
|
|
|
Try to use the textbox's KeyPress event instead of KeyUp:
<br />
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtFileName_DEV.KeyPress<br />
If e.KeyChar = Chr(13) Then<br />
If TextBox1.Text = "" then<br />
'Just jump out of the sub so your code does not try to search for nothing<br />
exit sub<br />
End If<br />
'Reaction when the enter key gets pressed<br />
End If<br />
End Sub
My advice is free, and you may get what you paid for.
|
|
|
|
|
Perfect! That did the trick.
Thank you very much,
Joe
|
|
|
|
|
I have a data logging program already set up that takes data from a serial connection and saves it to a excel file, but now what I need help with is taking the specific data from the one file and insert it into another while using calculations so the numbers will fill one column until a predifined number is reached then auto fill to the next column and so on and so on until it has to transfer to another sheet then continue the same process. Wow that does sound like alot to ask for so any little bit of that would be great in getting me started.
|
|
|
|
|
Why are you using an Excel file for this?? This sounds like you should be using a database. Managing the column use and figuring out when to start a new sheet is going to be a pain that you don't need to put up with if you just used the appropriate data store. You can then export what you need from the data to an Excel sheet whenever you need.
|
|
|
|
|
Let me start with a brief explanation of what this is for. My company builds concrete water tanks and in this process we prestress the tank with wire pulled to 3000lbs of tension we then put this info into an excel sheet that tells hows how much wire would be required in the next layer. It is critical that a certain number is obtained in prestress to achieve the strength required for our tanks. I am using this approach because the load cell that is taking the reading transmitts in ascii and I have found an excel program for communicating and retrieving the data. I have to then put it back into another excel sheet that takes those numbers and calculates the total number of wires needed in the next layer. I understand that this is a major undertaking and that is why I have turned to this site for help.
|
|
|
|
|
OK. If you're not very familiar with Excel, learn - now. In order to pull this off, you're going to need knowledge of Excel's object model. You can get the overview of the objeect model here[^]. Microsoft's Developer Center for the Visual Studio Tools for Office is here[^].
|
|
|
|
|
Thank you those are good links. Are there any other good links for code help. in explaining what code performs what function?
|
|
|
|
|
Hi Everybody,
I'm new to .NET and having a hard time figuring out how to extend a class in Main.aspx.vb (code behind main page).
Here is what I have:
(Main.aspx.vb)
Partial Class Main<br />
Inherits System.Web.UI.Page<br />
<br />
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Label1.Text = "it works"<br />
End Sub<br />
End Class
I've added a class called MainExtended.vb in the App_Code folder. I basically want to inherit "Partial Class Main" so I can write code in MainExtended class that can access the controls in Partial Class Main.
Can somebody guide me in the right directions? I've done lots of reading on inheritance... but I can't seem to get it to work - could not find an example that shows me how to get it working.
Thanks in advance.
|
|
|
|
|
Why are you creating an additional class?
Go to the designer, doubclick on the button, this should create the code in main.aspx.vb. Put your code in there.
|
|
|
|
|
I have no idea why you're doing this since this code should be in your Main class. Any code that manipluates the controls of a form should be in the form's class, not in a seperate class.
But, you can just create a standalone class with a method that takes a controls collection as a parameter. Or, create a class that inherits from Main. Neither of these is a good idea - use at your own risk.
Public Class MyOtherMainForm
Inherits Main
...
End Class
|
|
|
|
|
Hiya,
I was just wondering if it was possible to have a form inside a VB.NET dll made in VB 2008??
I can click on Project|Add Windows form... but when I type something like "Form1.Show" it says:
"Reference to a non-shared member requires an object Reference".
So I'm guessing I would have to somehow make the Form "A shared member" but I dont know how to do this.
Any help will be greatly helpful,
Thanks Lloyd A.
P.S. I've honestly tried looking on the internet on this subject but I was unsuccesful in finding anything helpful.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
The most annoying thing about Microsoft is its obsession with change.
|
|
|
|
|
I haven't actually tried to do that before, but you would normally use something similar to the code below to open up a new form.
Dim frmNew As New Form1<br />
frmNew.Show()
(I'm writing this from memory, I don't have VS open right now)
|
|
|
|
|
Hiya,
This seems to work, thanks, I didnt know that it was as simple to use forms in DLL files! Thanks again!
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
The most annoying thing about Microsoft is its obsession with change.
|
|
|
|
|
Hello
i am trying to get a value from a textbox but i just have its name in a string varriable
like in php $$name
can somebody help me
thanks
kosmas
|
|
|
|
|
REflection is what you need here. You need to find the control by name, and then access it's Text property, using reflection.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
you can enumerate all the Controls (possibly recursively) until you find one with a
matching Name property.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
|
I know that there is a namespace in the System.Io.Ports in VB 2005 and above, but I have an application in 2003 I need it for. Wondering if anyone knew of a way to use a port in '03 or knew of a .dll I can use for it.
Thanks,
Brian
|
|
|
|
|
Hiya,
You could just simply upgrade to VS 2005/8?
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
The most annoying thing about Microsoft is its obsession with change.
|
|
|
|
|
All you have to do is the same thing anyone is going to do. Google for ".net 1.1 serial port library".
Here...[^]
|
|
|
|
|
hi all
i work on text led display ( 16 row*64 column )leds , and i need a way or program to convert the arabic charters in textbox to 16 * 64 bitmap file and then to heaxfile to program the microcontroller .
thank you
|
|
|
|
|
The only idea I have for doing this would be to render each character to a small bitmap image matching the size of your character matrix and then use a C# processing library to get at the pixel data so you can see which pixels are turned on and off. Then you can use that information to geterate your hexfile data to send to the microcontroller.
|
|
|
|
|
Why do you need the bitmap as an intermediate step ? That's the step that is going to make this very hard indeed.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|