Import Excel files into SQL and vice versa using VB? - vb.net

I will try my best to explain in detail what information I am looking for =)
I would like to know how I could go about making a simple little program in Visual Basic 2010 that has a button you click with drop down menu beside it to search for an excel or sql file on your computer and then you select it. Then you click a button saying "import into sql" or a different button saying "export to excel."
These buttons would of course do what they say... either importing the chosen excel file into sql or exporting the sql file into excel.
Thank you so much for any help you might be able to offer.

I think you should look into the Business Intelligence Developer Studio that is built into Visual Studio 2008. It has a lot of developer tools that allow the transformation of data from SQL to flatfiles or vice versa. This is mostly done in the integration services area of the studio and is done through the creating of a ETL (Extract, Transform, Load) process. So to make a file that could be imported into excel you would save it as a flatfile that is seperated by a common delimeter that could then be hooked up to an excel sheet. Also, the BI development studio has not yet been updated to VS 2010 so you would have to get a copy of VS 2008.

Related

Linking SQL to AutoCAD 2016

So I have learned how to create a connection between AutoCAD and my SQL Server using the 'DBCONNECT MANAGER' tool within AutoCAD.
My next goal is to try and change the value/text of an existing label I have created in AutoCAD through an SQL update.
I am fairly experienced in SQL but I am very new to AutoCAD and the whole SQL-AutoCAD integration process in general.
I am setting up this question to ask if someone could point me the right way to achieving this SQL update.
Ultimately I want to be able to change the value of the label that is inside my AutoCAD project save from SQL.
Any advice/help/links/tutorials on this type of stuff would be extremely helpful as I have found very little on the web about this.
Thank you in Advance.

Visual Studio Program Using Excel on a PC that doesn't have Excel

I'm making a program that will eventually be used as a simple program to keep track of customers at a campground. I had originally made an excel spreadsheet for the owner where they could add how much each renter paid per month and I set it up in a way that it totaled each month and the whole year for him and displayed it like an accounting spreadsheet, with double underlines and the like. Now, he no longer has a copy of excel. I have set him up temporarily on google docs, but besides it not having all the functionality of excel, he doesn't trust it on the internet and has a hard time navigating to it.
What I'd like to do is create a program that would use forms to let him easily enter information, but display it either in the excel spreadsheet like he's used to seeing, or something that looks and prints pretty much the same.
I've seen people use SQL to work with access and excel. I'd like the connection string for that if anyone knows it. I have Visual Studio 2013 and I have Excel 2010 at home and work and 2013 at work.
My big question for you guys, that I can't find any information on is whether or not excel will work if I install the program on his computer that doesn't have excel installed? Does it work because it's part of the program? Can I only use the sheets and formulas that I set up when I created it? Can I generate new sheets using the program once it's installed on a pc that doesn't have excel installed on it? Thanks a lot for the help guys. I can't find information on this anywhere.
It depends what library you use. If you use Microsoft.Office.Interop.Excel than you will need to have the specific version of excel installed or at least a version that supports your interop assembly (my past experience was that it had to be exact).
The other option is to use another standalone third party library that reads the zipped XML files (.xlsx) and can manipulate it through that. Some libraries worth mention:
NPOI
EPPlus
ExcelLibrary

VS style snippets in SSMS 2012. Do they exist?

I am trying to setup a simple snippet in SQL Server management studio. When I heard the word "snippet", I assume that they would work like they do in Visual Studio. By that I mean that there are variables that get filled in, etc... I am not seeing that.
Can someone tell me whether SSMS 2012 supports Visual Studio style snippets. If so, can you provide an example of a snippet that supports variable replacement.
This might be close to what your looking for. Under View->Template explorer is a list of a whole bunch of structures that you regularly use when working with, building, developing databases. You can also get to it using Ctrl+Alt+T. There are literally hundreds in there. Everything from building a view to setting up a trigger to creating XML schemas.
The really nice thing with templates is you can build your own structures that you regularly use. I have built quite of few of my own templates to hold snippets that I have acquired from the likes of Brent Ozars blitz scripts and others like the improved SP_WHO from Adam Machanic and such.
While maybe not as fancy (read interactive) as the ones you'll find in the Visual Studio projects I find them very handy.
If you use these templates there is another little feature that can be very handy. If you press Ctrl-Shift-M (or use the toolbar button that shows an A->B) you get a dialog that lets you easily replace the template parameters with your own values.
Update post research into SSMS2012
I just recently started using SSMS 2012 and see there is a new feature that I wasn't aware of. When right clicking you do in fact see the 'Insert Snippet' drop down. I understand your question better now. Apparently however, these are pretty much the same as what I posted above.

Storing excel data on Sharepoint

I'm looking for a way to store data generated by an excel template somewhere on SharePoint 2010. I am very new to SharePoint and still learning some of the abilities etc.
The goal is to store the data created by an excel template when a staff creates a quote using the template. I want to have the quotes available for historic purposes and compare the data.
I understand that SharePoint may not be the correct solution and that there exist much better platforms but right now I'm stuck with SharePoint. Any advice would be appreciated.
I found the answer to this. SharePoint has a number of webservices that can be used. After doing a heap of searching I found that using the Visual Studio Professional a Excel Workbook Project can be setup with embedded Visual C# code. I am currently implementing this.

How to edit default templates for database objects using VSTS 2008 Database Edition GDR Version

I'm giving Visual Studio Team System 2008 Database Edition (GDR Version) a go on a new project I'm working on and have come up against a slightly annoying problem that I am hoping someone knows how to resolve.
In a nutshell, I would like to alter the default templates used to generate database objects, particularly stored procedures. In the past, using SSMS, I have simply created my own templates which contain the formatting, default number of parameters, etc, that I would generally like to use whenever I create a new sproc. This obviously eliminates a good amount of hand coding and just "feels right" to me to have some consistency in my T-SQL code.
I've tried editing the .sql files located in ..\Microsoft Visual Studio 9.0\DBPro\Items by adding the formatting and default constructs I would like to use. Unfortunately, I haven't been able to get VSTS to recognize these changes. When I add a new stored procedure using the GUI it still uses the default stored procedure formatting.
I've tried shutting down Visual Studio and starting it back up after making these adjustments, but that doesn't seem to have any effect.
Does anyone know how to do this? I haven't been able to find any documentation on MSDN or the DBPro teams' blogs, but I have a feeling this can done. Any help or suggestions would be greatly appreciated.
Microsoft Visual Studio 9.0\DBPro\Items is a legacy directory. These are the wrong templates. The right templates are in Microsoft Visual Studio 9.0\VSTSDB\Extensions\SqlServer\Items. Editing these works, and you don't even have to close visual studio.