Accessing TFS database using Vbscript - api

I have been assigned the task of creating a web dashboard with information I retrieve from a TFS database using the available API. Ideally I would like to create this using Vbscript as I have existing code that could easily be reused, however I am unsure if there is away of connecting to the database using VBScript, any ideas if this is achievable??

I'll admit vbscript seems like a strange choice. That said, given the TFS API (the Object Model) is a .NET assembly then as long as you can call the methods properly from your VBScript code you should be OK.
As for calling .NET from VBScript have a look at this question: How do I call .NET code (C#/vb.net) from vbScript?

Related

How to connect to TFS through VBA code

Really need a assistance here. Google didn't help me much. I found this is somewhat plain solution.
http://www.codeproject.com/Articles/183317/Update-TFS-WorkItem-from-Microsoft-Access-using-VB
But is it possible to connect the TFS without the help of dot net visual studio. Something like adding the reference and using those in code.
The TFS Client Object Model is not exposed to COM and there is no way to call the .NET objects directly from VBA without a COM wrapper.
If you're connecting to TFS 2015 or Visual Studio Online, you may be able to use the REST API's by directly invoking the REST calls.
Not sure why you would not just use VSTO in Access, which allows you to use C# or VB.NET for your add-in.

How do I upload an Excel sheet to a SQL table in a Lightswitch web client?

I have a lightswitch project in visual studio 2013, using vb.net. I would like the user to be able to click a button and have lightswitch find an excel file, and upload that file to a sql table according to a pre-determined column mapping.
My preference was to use the Office Integration extension for visual studio, which I got working with VS 2013 by downloading it from this link: http://www.ge.tt/71iuRQv/v/0
However, the documentation and examples for office integration seem to be very heavy on getting an excel spreadsheet into a display in the lightswitch web client, rather than into the sql data table, which is where I need it. Here are the examples I've been following:
http://blogs.msdn.com/b/bethmassi/archive/2012/07/18/new-and-improved-office-integration-pack-extension-for-lightswitch.aspx
Alternatively, I have an existing stored procedure, and I can request that the server call this stored proc by sending a web API extension from the client to the server. I have this working already for other stored procs, according to examples from Beth Masi and Paul van Bladel. (Stackoverflow won't let me post the links...)
The undesirable part of this approach is that the stored proc is old, and messy.
I've searched and searched, but have yet to find anyone approach this problem for VS 2013 with lightswitch. Any useful advice?
I've used the method detailed by Matt Sampson to store word files and it works very well. Since it just stores the raw binary it should handle Excel files just as well.
If you're creating the table in LightSwitch, use the Binary Type. If you use SQL create scripts use varbinary(MAX).
You need to create a custom Silverlight dialog box to gain access to the OpenFileDialog object. Then open the file in as a FileStream.
Finally, you need to add a handler for the closed method of the control and then show the control to the user. Most likely done in a button. This needs to be done on the main dispatcher.
The code examples are in C# but I just used one of the many available translators out on the web and copy/pasted the VB.NET code.
Another option might be to consider shelling out to the DTSEXEC run-time to execute an SSIS package to perform the upload - especially if the target Excel spreadsheets have predefined layouts and content data types.
Even simpler, you might be able to use the SQL Server BULK INSERT command to get the job done - although that would require a SQL Client connection to your database.
HTH

How can I use external VBA source code with MS Access?

I am writing a VBA script to import data from an Access database to a remote database server. (It happens to be PostgreSQL, but I don't think that's very relevant.) At the moment, my scripts are embedded inside an Access database. However, I would like to version my scripts like I do my other source code: as plain text so SVN can give me good change tracking.
I would also prefer not to have to deliver the source files to the client for them to use the script. In other words, I would like to deliver the import tool already compiled into the Access database. Is it possible to do so?
Or am I chasing the wrong rabbit? Is there a way I can use the Access libraries without embedding any code into the Access database? My searching suggests not, but I'm open to the possibility. This is the first thing I've ever done with VBA, so there's a ton I don't know, I'm sure.
I think I was going down the wrong rabbit hole (and I think I was using a non-existent idiom). Turns out that there are some .NET interop DLLs for Office. My machine seems to have the .NET interop DLLs already installed with Office, so all I had to do was add a reference to the Microsoft.Office.Interop.Access DLL and create an application object:
var app = new Microsoft.Office.Interop.Access.Application();
I think a .NET app is going to be more suited to my needs. I'm not going to be doing a lot of Access specific things. This will allow me to have my source under version control as usual. The only downside is that any development machine (and build server, if I automate the build) will need Access installed, but that was going to happen with a VBA script, anyway.
If you don't want to do it within Access, you may want to tag this differently.
You can deliver your database to the client as an MDE file, which is a compiled and stand-alone Access database. The client will not be able to see the modules or other VBA code in this format, if that is your main concern.

Automate MS project

Is there a way that we can automate the input in ms project 2010. Below are the scenarios:
We have a vb.net application that uses to inputs task name, hours, estimate and completion date time.
Is there a way that we can upload those date in ms project 2010.
There is a way. If you use desktop version of MS Project (Pro or Standard) then the only option you have is to use OLE automation.
Through the OLE Automation you will get a reference to an instance of Application class which is key class in every MS Office application. From the Application you can get a list of currently open projects using Application.Projects collection or even get current project using Application.ActiveProject.
As soon as you have a reference to a project you can access all tasks in the project using Project.Tasks collection. (Index of all collections starts with 1)
The most of Task fields like Name or Start date are available through properties of a Task: Task.Name = "something" or Task.StartDate = "1/1/2001"
Anyway here is a link: msdn.microsoft.com
Another story is if you have Project Server and you want to do all the things faster. In this case you should use PSI (Project Server Interface) - collection of web services which give you access to the most of Project Server functions.
MSDN has great articles with samples how to work with projects using PSI and here is a link: MSDN about PSI. You can search around the link to find more articles about other services available through PSI.
If you're able to put your data into Excel as mentioned in your comment, then it would be fairly straightforward to write a VBA program that reads the excel data and updates the Project tasks with the data in the workbook.

SSIS - SharePoint to SQL without Adapter Addin?

Im looking to Extract a SharePoint List (WSS 2.0) to a SQL(2005) Table using SQL Server Integrated Services.
First off I am aware of the "adapter" that does this from http://msdn.microsoft.com/en-us/library/dd365137.aspx however I'm just wondering for compatibility purposes if it can't just be done "out of the box".
There are only a limited number of "Data Flow Sources" to select as alternatives and I am unsure if any of these would be able to work in a similar way either directly to SharePoint or via SharePoints web services (e.g. http://server_name/_vti_bin/Lists.asmx) From the list of these sources it looks like the best option would be the OLE DB connector, but not sure how it would do this.
Any help you have would be great,
Mark
You can use Script Source task to talk to WSS Lists Data Retrieval Web Service. But I would strongly recommend using the custom Add-in.
Overview of WSS Webservices
Calling Sharepoint Webservices From SSIS