VB Net Class launched from Windows Scheduler - vb.net

My application contains lots of forms which use buttons, gridviews etc. I'v made new form (buttons, labels, richtext for api response for testing etc.) which gets data from API, tested it and works. My idea is to make task schedule in Windows and run this sync every day at 8 AM. I'v made a class which got only code for getting data and saving it into database (save new or update). How to make this particular class make run inside project with 100+ forms using Windows scheduler?

Below will be one of the (if not only) way forward :
Make a separate console application with this class.
Generate the exe file
Use Task Scheduler to run it at a specified time

Related

Can't run different vb.net applications based on the same original app

I have a desktop Windows Forms application I built.
As we try out improvements to the program, I make the changes on a test version of the application, which connects to a test copy of the Microsoft SQL database on the back end.
Basically, to start out, I just copied the program to a different directory, re-named the assembly, created a different PublicTokenKey and used that.
The problem is when I try to run a the test copy and the live copy at the same time. It pretty clearly thinks they are the same program (when I click on the second one, the "busy" circle simple turns for a second, then the already-opened icon in the taksbar gets highlighted), even though they show up in the Task Manager as differently named applications.
What do I need to tweak in Visual Studio so Windows 10 will recognize them as different, separate programs?

VB columed profile/process list with embedded sqllite database for editable process parameters

I have no idea how to make this in Visual Studio 2010. I'm trying to make a program that has a "grid" with columns. It will have a option to name a new profile/process, which is then added to the grid/list.
I can then edit the profile/process by clicking a button and editing the parameters that the process runs with.
most of the time these processes are the same same program/executable, just multi-instanced.
I can then start the process with the given parameters after I have setup it's profile.
I want to be able to monitor the RAM/CPU usage in one of the colums of the record/profile/process, sort of like the task manager and also "maintain" the process and keep it running/restart automatically it so it doesn't stop or crash unless directed otherwise.
I want these profiles/process parameters to be stored in a sqllite dll embedded database.
I would appreciate your help. thanks.
The very first step is for you to get all process, then place it in a container.
From there you can rename the process via My.Computer.FileSystem.RenameFile(file ,newName)
I prefer using datagridview, as with it you can easily add/remove columns and refer to the data. Assuming you have a datagridview with one column:
For Each ito As Process In Process.GetProcesses
Datagridview1.rows.add(ito.ProcessName.ToString)
Next
this will get you through the first part.

vb.net - How do I selectively communicate with two instances of a program?

I'm new to VB, and so forgive me if this is a simple question.
I will be running multiple time consuming (single thread) processes in a program (that allows automation thru COM). And so to save some time, I want to open two or more instances of this program and run them simultaneously. But anything that I try to do on the program, it happens on the first opened program. This is what I have which my intentions are to open two instances of the program (which does correctly), and open a new document in each of the instances (which what it does is open two new documents in myProcess0 and none in myProcess1. Note: I have System.Diagnostics namespace activated.
Using myProcess0 As Process = Process.Start(programPath)
myProcess0.WaitForInputIdle()
pws0 = New COMprogram.Document
End Using
Using myProcess1 As Process = Process.Start(programPath)
myProcess1.WaitForInputIdle()
pws1 = New COMprogram.Document
End Using
Note: The COM program does not allow to create an handle for the program (like Matlab allows with MLApp.MLApp)
Any help will be appreciated it! Thanks in advance!
This is not exactly a solution, but my current "brute" workaround. This works if your iterations are independent of each other and wish to use multiple instances of a program in the same computer to perform these iterations (but for some reason that is unknown to me, any "Application" objects created point back only to the first instance of the Application).
What I'm doing, is tricking the code by using "desktops": http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx
I simply open the VB code and a Application instance in each desktop, and for some reason the VB code only interacts with the Application opened in the current desktop and not on the others. This happens as well with Matlab somehow. For some reason, all Matlab Application objects reference the first instance.
This will be up to the COMprogram API. With Word or Excel, for example, you can't specify which instance you're accessing without manipulating an Application object.

SSRS 2008: How to generate multiple reports immediately?

Im building a site which brings up SSRS reports by opening new windows with the report url and report parameters. I can currenlty open a window for each report they want to run.
However, they also want the option to save the reports to a file share or Sharepoint of their choice, instead of having a bunch of browser window pop-ups for each report.
I understand I can use SSRS web services to setup a schedule (to run in a couple minutes from the time of request) which can save those files to a file share (or Sharepoint) but that seems like a hack to get a one time generating of reports onto a file share or sharepoint.
Is there any other way to instantly generate a bunch of reports, one time, immediately, without having to set them up on a scheduler that is set to run a couple minutes from the time they set it up?
"Note, they DO NOT want one report that has all the reports in it, these are seperate reports that are already built, and they want one file/window per report."
Not sure what you want when you say you want them all at once but one file window/per report? What presentation layer is showing this? You can make three seperate web calls at the same time to the webservice instead of the hosting site:
h ttp://(servername)/(ReporstServer)/PathtoReport1
h ttp://(servername)/(ReporstServer)/PathtoReport2
h ttp://(servername)/(ReporstServer)/PathtoReport3
instead of
h ttp://(servername)/(Reports)
If you just mean 'separate pages' on an Excel workbook you can do that with one report nesting other sub reports. You can build a master report that has rectangle objects that define pages as their properties and place a sub report in each of these rectangles.
Or you could make an html page that references the calls three seperate times in a 'form' object of the HTML doing a 'post' command.
< Form id="SSRSRender" action="http://(servername)/(reportServer)/(report) method="post" target="self">
"However, they also want the option to save the reports to a file share or Sharepoint of their choice, instead of having a bunch of browser window pop-ups for each report.
I understand I can use SSRS web services to setup a schedule (to run in a couple minutes from the time of request) which can save those files to a file share (or Sharepoint) but that seems like a hack to get a one time generating of reports onto a file share or sharepoint."
That's not a hack, that is the preferred method of saving a file is using the built in web service scheduler. Once a report is hosted (on a server hosting the SSRS) it can have configs set for SMTP send outs, file saves, and snapshots made.
If that is not enough you can create your own proxy classes if you want in C# or VB.NET and try to build your own front end talking to SSRS through SOAP requests to the Web Service.

vb.net winforms design / layout issue

I am working on a windows forms project that will allow a user to have an interface to the database, and another will be a nightly run process file that will update the database table.
The user will add new records to the table, whereas the nightly process will update the columns with new values (think mortgage interest rates)
Both these projects will be using the same business logic component that has the calculations needed to enter values into the table.
The way I am figuring this out, is that I will have two exe's (one for the interface and one for the nightly process) and have a central object that will host the calculations. What would be the best object for this purpose?
A class file?
A windows service? (I want to stay away from a windows service, because it will have to be running all the time)
Thanks
You're on the right track.
The central object with your business logic components should be a Class Library project (outputting a DLL).
The Winform project that allows users to interface with the database should reference (and use) your Class Library project.
The nightly process should run a Windows Console Application that would also reference and use your Class Library project. Like Davita suggests the nightly process should be called from a Windows Scheduled Task.
if I understand correctly your question, you can consider Windows Task Scheduler. You create a job which will execute your exe at any given time of day.