Private Sub LoadData(Of T)(ByVal query As ObjectQuery(Of T),
ByRef result As IEnumerable(Of T))
If Connection.State = ConnectionState.Open Then
result = query.ToArray
Else
AddHandler Connection.StateChange,
[Code]...
In the above code I am trying to recurse the LoadData function when the connection is unavailable, I want to defer the loading to when it becomes available. The problem is the above code leads to a compiler error, since a ByRef param cannot be used in lambda expressions.
read the COMPLETE email before giving me instructions.I say that because it seams like who ever is responding is only reading part of the email and responding.I have followed your instrutions and I still can not get myhello.vb to compile.
Both vbc.exe and mylello.vb is in the same folder c:program files
"C:Program Filesvbc.exe myhello.vb"
You stated that I should run command prompt as administrator and tye the same command as you do. what (as administrator) is. Please walk me through the complete process. Please do not tell me to run the command prompt as administrator because I do not know what that mean.I can not speak to my administrator. Also I attempting to compile a sample VB that came with the software, so using Visual Studio is not the solution.
I have a simple dos command, I use to stop a java service which I am trying to execute within VB.NET, however it doesn't seem to stop my service.My DOS command which works is as follows:
NET STOP "Java Quick Starter"
My VB.NET attempt is as follows but it doesn't work:
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Visible = False
I like to clarify the doubt regarding vb.net programming. my question is as follows.1. While executing the vb.net program, whether it takes RAM space or Hard disk space.
I wish to get my VB 2010 program to wait a few seconds after executing a command, and then exit.
For example:
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'do.stuff 'wait a few seconds
I am in need to delay the execution of a line of code, say, by 5 seconds. But by doing System.Threading.Thread.Sleep(5000)
the whole UI hangs and I don't want that to happen. Because I want to be able to display something in a Window that a user will be able to see. Does anyone know of an alternative of achieving this?
I have finished creating the code for my client/server application although both parts currently execute modules/in console(this was for testing purposes).I am now looking at making both parts of the program completely invisible (they will eventually be executed as a Windows service upon startup). How do i go about this? Does the code need to be copied in to a "Windows Service" project, or is there a way I can hide both of the modules upon execution?
I created an MSI for my application and i want my dll to execute during installation of this MSI. How can i add my dll to MSI. I read something on ORCA but getting error.
add my dll to msi using orca. My dll contain a message box and registry entry
i am getting an input from the user and i m checking in try catch statement. what i want to do is when the exception is caught i want to stop executing the rest of the code. my code is as below
Public Class AddForm Private Sub Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add.Click Dim inc As Integer[code]......
I have this commandline in a cmd file "C:MentorGraphics7.9EESDD_HOMEcommonwin32inasc_out.exe" "-PROJECT=D:VeribestData55250u0555250u05.prj" "-OUT=D:VeribestData55250u0555250u05.inp" "*(*)"
And this peace of code
Dim program As New Process() Try program.StartInfo.FileName = Chr(34) & PrjSets.ProjPath & "ascii.cmd" & Chr(34)
[Code]....
And it generates no output If I double click on the command file it generates output
My application does some intensive tasks on a second thread, while updating the main form. I want to show how long these tasks have been running (increments every second), i've read timers can get out of sync and even fire off multiple ticks at once, so how can that be fixed, or what's a better solution for this?
PFB the code for a search button where when a user enters a text in the text box ,it takes the keyword compares it with an xls which has 1600 rows and 16 columns with keywords.If the keywords match, it has to full the 3rd column where the name is specified.Its running but its taking more than 20-25 mins for processing.I knw searching 1600 rows and 16 columns will take time but pls advice if i can make this process a lil faster.
i'm building a basic server program that I want to recieve commands and execute them sent from a client program and I'm using my home network to test it out. I've got no problem with the communication between the client and server programs and have used a simple Send Text function to communicate to the server program which simply brings up whatever text was sent in a message box.
I've decided that constantly updating the program and transferring the new EXE file just doesnt work as I have to keep starting and stopping the server program to do that just to update the list of commands it recieves. So say for example I've got a button on my client program that tells the server to open the cd-rom draw on that computer, it sends this in the form of simple text openCDdraw" and when the server recieves this, it pops open the cd draw and so on and so on... but I thought a better way of doing this may be to say have the commands listed in a SQL database and when the server recieves a message it searches through the database to find the correct command and executes the code associated with the command.
Now I can retrieve the information fine in to a string variable ("Dim a as string, a = dr.getvalue(3)") but where do I go for there? This is the problem see. My apologies if I've gone a bit long winded on this one but thought it necessary to explain what I'm doing. I've heard of dynamic code execution but when I tried a project I found on the internet it had been coded in C# and I don't know any C nor do I want to as I'm a VB veteran and have updated myself with the way of .NET now so am not going to start all over again with learning C. Does anyone know of an easier way of doing this? Static code is so easy to do because it is typed straight into the coding sections and I had already thought about creating loads of subs/functions to execute each command but again that involves updating the EXE file every time so there must be a better and easier way of doing it.
Can I also just point out that this little project i'm working on is not for a TROJAN or whatever that old NETBUS program used to be called, it is simply so I know how to do it and can use it for other things that I'm working on and through. Also I'd just like to know how to retrieve and execute code from a database or text file.
How to make a program wait till a shell command finishes? For example:[code]In this example the line "Finished" is first written and only after then the shell function starts. How to start the shell function first, and only when it has been finished write the line "Finished"?
According to the answers to another question, the VB user interface cannot be updated if the thread that created it is busy: hence why big computational jobs usually have to go in a background task.Here's what's mystifying then. I have the following code. It's called over in-process COM, like this
client calls showform() client does loads of work, freezing up its own UI in the process client finishes work, returns to updating its own UI
At step 2, the VB form is there but frozen - you can't interact with it. At step 3, the VB form becomes usable. But why is this? Surely the thread of execution has returned to the client? If the client is somehow handling events for the form, by what magic did it know what events to handle and where to send them?
I have an old ASP (not ASP.NET) application It runs okay on Window 2000, and Window 2003 servers, but not on Window 2008 server. What I should do to find out the cause of probelm on Wind2008.[code]...
I am trying to run a vb .net 2005 executable file in the Windows Pre Execution Environment. Tha application is very simple, it will show a form with 2 buttons, one button is exit, the other runs a shell command.When i try to run the exe, absolutely nothing happens. The form is not displayed at all. Anyone know why? The app works fine in a normal windows environment.
The purpouse is to execute a SP, but sometimes the DBA modifies the SP without any notification.When the SP is modified and runs the app, the code freezes in the line 7 but does not return a value nor error, even, after 2 hours it remains in that line, I have set the command.timeout (line 6) but it doesn't work either.how to stop the execution of the SP after a period of time.
I am trying to allow my VB.NET EXE to have a variable defined by the run command. The problem is I have no idea what the terminology would be for this type of run.
For example - the shortcut is set to do "myexe.exe debug" This would set a variable to "debug" which on execution my app knows to enable a debug mode.I've done it in batch scripts before - it just enables the "%1" variable or "%2" based on the location (e.g. test.bat hello world - hello would be %1 and world would be %2).Hopefully I explained it well. I tried searching for "variable in execution path" and "variable on execution" with other mixes, but none of those searches return what I am looking for.
Based on the code below..How do I stop the execution of the codes at a certain lines if a certain condition is fulfilled? Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
okay this may be a simple answer so I apologize if it is. What I'm trying to do is when button1 is clicked for a text box to display text. Then when that same button is clicked again, that text box will display different text. Then so fourth for about another 4 times. Now I know putting this all together will create one big execution, which I don't want. I just want the application to wait until the button is clicked again to display different text.
I have a VB.NET subroutine that is triggered by a timer. I have found that on occasion, if the routine runs for a long time, the routine will be triggered again while it is still running with unpredictable results. Is this normal? Is each copy of the routine running in its own thread? Is there a way to serialize the routines? Right now I use a Boolean that I set True on entry and False when I am done so I can check if the routine is running when I enter it, but I thought that there might be something more elegant.
Using this code, before I added the funky "abort" button code - stopping it using the Stop Debugging button in the IDE blue screened my computer every time, PROCESS_HAS_LOCKED_PAGES - Anyone care to try it ? Win7 Ultimate , VS2010 SP1. This machine has never blue screened since it was built. Code is by no means exotic in any way.
Public Class Form1 Dim Abort As Boolean = False Private BStart As New Button
I'm going to create some command line tools that make use of some large library DLL's. For security reasons I plan to embed the DLL's in the command line's EXE. Example:Suppose the CL's (command line tool) functionality is to just copy a file from A to B. The procedure to do this is included in a 100MB library DLL. If I would just take out the lines of code from the DLL and paste them in the CL's code then the CL would only be 10Kb.But I don't want to do that, so I embed the full library in the CL's EXE, which will make it 101MB in size.I once read somewhere (cannot remember where) that Windows would only use the part of the EXE that's actually used. So if that's true then it shouldn't matter if the EXE size is 10Kb, 100MB or 1GB.I own the code of the DLL, so if the best solution is to not include the whole DLL but just only link to or include those code files, of the DLL project, that are used by the CL then I will go that way.will the 10Kb CL run faster and consume less memory than the 101MB CL?
I am executing a SQL Server 2000 DTS package using C# by following the code from this article [URL]. once the package is executed I am looping through each step to find out if any step has failed and get info about error if it has failed. I also use this information to find out if the package has succeeded or not (package failed if anyone step has failed).