Microsoft Visual Studio





Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have developed a c# application that encrypts and decrypts files in a particular folder based on selected Bluetooth device range. If the selected Bluetooth device goes out of range, then the files in the particular folder gets encrypted and when the selected Bluetooth device comes back in range , then the files of the folder that were encrypted gets decrypted.
Here is the source code :
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using InTheHand.Net.Sockets;
using System.Threading;
using System.Data.SqlClient;
using System.IO;
using System.Security.Cryptography;
using System.Text;

namespace Folder_Security
    public partial class EncryptDecryptTool : Form
        List<string> discoverable_devices_items = new List<string>();
        BluetoothDeviceInfo[] paired_devices;
        string key;
        public EncryptDecryptTool()

            cmb_UsersDisplay.Text = "Device List";
            key = generateKey();

        private const string _IV = "EncryptDecryptFile";
        private string generateKey()
            AesCryptoServiceProvider aesCrypto = (AesCryptoServiceProvider)AesCryptoServiceProvider.Create();
            return ASCIIEncoding.ASCII.GetString(aesCrypto.Key);

        private void start_devices_scan()
           Thread bluetoothScanThread = new …
Build your data science skills into a career
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

I have maintained a database dbo.Devices that stores information about paired Bluetooth Devices. I have attached the database file image . I have also created a combo box cmb_UsersDisplay that displays the list of Devices that is stored in the database. Now I want to store the Folder_Path of the device name that i select from the combo box cmb_UsersDisplay in a variable and display it on the console. I have tried to execute it using the below code, but the string displays the command not the the Folder path from the database for the device name I have selected from the combo box. For example: If I select a device name Moto E4 plus from the combo box and its folder path is stored in the database ,then it must display the Folder path associated with that device name on the console.
string selected_item = this.cmb_UsersDisplay.GetItemText(this.cmb_UsersDisplay.SelectedItem);
            SqlConnection con = new SqlConnection(@"Data Source = (LocalDB)\MSSQLLocalDB; AttachDbFilename = C:\Users\HP\Documents\Visual Studio 2015\Projects\Folder_Security\Folder_Security\Database1.mdf; Integrated Security = True");
            string Sql = "select File_Path from dbo.Devices where DeviceName=selected_item";
            SqlCommand cmd = new SqlCommand(Sql, con);
I want to develop an application in c# using visual studio in which if I select a particular folder from the computer then it must list all the sub folders and files stored in that selected folder in the form of lists.
I recently built an ASP.NET application using Microsoft Visual Studio 2017.  For some reason I now see dlls from the 3rd-party vendor (DevExpress) appearing in the bin folder.  In the past the references to the dlls was made from the install location of the dlls (as indicated in the registry).

a. What setting did I modify to cause this behavior?
b. Is this the best practice?

I would much rather continuing with this practice.  I need to set the properties in the rest of my projects.

I just download Microsoft visual studio 2017 but the window is not the same as 2010. Can you please tell me how to create a new mvc project in it with c sharp coding? I am using windows 7
Good afternoon experts. Newbie here to I created a form with ms visual studio 2017 community addition. The form contains a datagridview that connects to a sql database (sql 2008). On my form I have several text boxes that are used to enter data which then populates my grid via a "add record" button. The connection to my sql database is handled in a class I called SQLControl.vb (if that matters). Listed below is my code for the add record button. So far everything works great and now what I need is a check to prevent duplicate data from being entered so I am looking for a check against my text box and datagridview. The field (not a primary key) I would like to validate against is called EMPL_ID (employee id). I don't know how to accomplish what I'm sure is a simple task.

Here is the code behind the button:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If txtboxEmplID.Text = "" Or txtboxLastName.Text = "" Or txtboxFirstName.Text = "" Or txtboxEmailID.Text = "" Or txtboxSupervisor.Text = "" Or txtboxSupervisorID.Text = "" Or txtboxManager.Text = "" Or txtboxManagerID.Text = "" Or txtboxSupervisorEmail.Text = "" Or txtboxMgrEmail.Text = "" Then
            MsgBox("All Fields Are Required", MsgBoxStyle.Information)
            Exit Sub
        End If

        'Add SQL Params & Run The Command
        SQL.AddParam("@Empl_ID", txtboxEmplID.Text)
        SQL.AddParam("@Last_Name", txtboxLastName.Text)
C# Visual Studio WinForm.  Upload Image.  I have 4 possible images able to upload.  Sometimes only one image needs to be uploaded.  Currently, my code works if I upload all 4 images.  If i leave one blank, it errors out with "Empty path name is not legal."  How do I code to allow null path if no image.



                if (frtBillTextBox.Text.Length>0 && maltIDTextBox.Text.Length>0)

                    string FileName = fBImageContentTextBox.Text;
                    byte[] ImageData;
                    fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
                    br = new BinaryReader(fs);
                    ImageData = br.ReadBytes((int)fs.Length);

                    string FileName2 = sHImageContentTextBox.Text;
                    byte[] ImageData2;
                    fs2 = new FileStream(FileName2, FileMode.Open, FileAccess.Read);
                    br2 = new BinaryReader(fs2);
                    ImageData2 = br2.ReadBytes((int)fs2.Length);

                    string FileName3 = wCImageContentTextBox.Text;
                    byte[] ImageData3;
                    fs3 = new FileStream(FileName3, FileMode.Open, FileAccess.Read);
                    br3 = new BinaryReader(fs3);
                    ImageData3 = …
Visual Studio LINK warning LNK4098
I have developed an application that selects one file at a time for encryption and decryption purpose. Can someone suggest me how to run a loop so that I am able to select multiple files at a time for encryption and decryption purpose.

In visual studio when write: ' os [space] appears '' aSender As Object,'.
1 - Write ' to comments
2 - Write os word
3 - Press KEY space
4 - Appears aSender As Object, instead os word

best regards
Easily Design & Build Your Next Website
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

I have been using VS 2008, and have installed VS 2015 side by side on the same computer. I have projects compiled in VS 20015 from another computer that compile just fine. But when I open those projects and try to compile them in the new VS 2015 on this computer they will not compile. In fact, even creating the simplest "Hello world" application will not compile.

I get errors on standard VS header files. For example, it throws errors and warnings on Windows.h like:

Warning      C4067      unexpected tokens following preprocessor directive - expected a newline      windows.h            

Error      C2061      syntax error: identifier 'LPCSTR'      
Error      C2061      syntax error: identifier 'BYTE'      

I can't figure out why this is happening. Anyone have an idea?

I'm using visual studio with access, is there a way to prevent 2 users from editing the same record? Like if user 1 opens a record while user 2 already has it open, is there a way that user 1 gets a warning message that he can't edit the record?

Thank you for the help.

How would you write a query to get Customer Id, VisitDate, NumberOfDaysFromFirstVisit from the tables below?

Id      Name
101      Name1
102      Name2
103      Name3
…      …

Id      VisitDate      VisitedCity
101      1/1/2017      City1
101      1/5/2016      City2
101      1/3/2016      City3
102      1/1/2016      City1
102      1/5/2016      City2
102      1/3/2016      City1
102      1/1/2016      City2
103      1/1/2017      City1
104      1/1/2017      City2
105      1/1/2017      City4
...     ...                     ...

Thank you in advance.
Hello. I am fairly new to programming and I am learning I am currently using visual studio 2017 community. I created a form the contains entry fields along with a dataviewgrid that stores the information based on what was entered in the text boxes. The data is being stored on a sql database (2008). My form has two buttons. An add new button and save button. Basically I enter info in my text boxes then hit the add button, This populates my data grid. The issue I am having is with my save button. When I press the save button I received the following error:

System.InvalidOperationException: 'Update requires a valid updatecommand when passed datarow collection with modified rows. I don't know how to correct this? Below is my simple code if it helps.

Public Class Form1
    Private Sub CamTagIssueBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles CamTagIssueBindingNavigatorSaveItem.Click

    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'ControlledItemsDataSet.CamTagIssue' table. You can move, or remove it, as needed.

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
I have a desktop application written Microsoft Visual C++ using Visual Studio 2017.  Its a single-doc MFC application.   Rather large, developed over the past 15+ years.  Now I want to be able to do something different: normally, of course, the application starts up and shows its GUI on the screen.  I want to add a mode (will have the App check for the presence of a certain file at start up) in which it does not pop its GUI up.  Ultimately, I'd like to have the ability to run it either A) with its GUI as usual, or B) as a GUI-less executable, probably in a windows service.  The app contains a socket-based message system that listens for commands and sends responses -- so when it is running in GUI-less mode, it will be another program talking to it over this socket channel in order to have it do useful work.

So, how to do this?   Maybe forget about the windows service idea for now -- just simply how to start my application and have it run without ever popping a GUI?   The structure, due to MFC, with the Doc, the View, the InitInstance code, the MainFrame class -- all that stuff is kind of mysterious to me.  I just used the structure that the MFC wizard gave me (when I first created this App back in Vis Studio version 6!).  Now it seems I may need some understanding of how to launch the system, but without Mainframe and the View popping up, etc.  Some of the Apps actions occur due to "OnTimer" code which might be on a dialog class -- so it seems to me I'd have to rework that…
When building code, I am not seeing my changes.  I've changed a simple Text Header on a page and ran the code and it does not change.
I've cleared my cache, restarted, tried a clean build and am at a loss as to what cold be causing this.

We have tested and this is only happening on React JSX pages.  It doesn't look like Webpack is compiling the changes but rather old code.
I am using VB.Net and Visual studio 2015. I have an application with a Access database table (.accdb) that is nearing the 255 field limit. Therefore, I have split the table into two tables and created a nested Parent/Child relationship between the two tables in an attempt to overcome this limitation.

The problem is that I cannot update the two tables when the Save button is pressed. The TableAdapterManager will update the Parent table, but not the Child table.

Has anyone had this problem and found a solution? I have seen many other asking the same question, but I have not seen any solutions. Below is the code for the Save button.

 'Save Button
    Private Sub ParentTableBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles ParentTableBindingNavigatorSaveItem.Click

    End Sub

Open in new window

Excel 2016: How to set the 'start up' form or some other sub-main.

if I write an app in excel that has multiple forms and multiple modules, can I set which form starts when the user hits the green arrow 'Go' button from the VBA IDE ?

I am looking something like what visual studio has were you can set the 'start up' form or some other sub-main when the app runs.

Hey all I have the following image box' sizes on my WPF form:
 Box |Width |Height
 1   |357   |272
 2   |357   |272
 3   |365   |460
 4   |365   |265
 5   |715   |455
 6   |360   |465
 7   |360   |465
 8   |360   |465
 9   |540   |290
 10  |540   |290

Open in new window

So visually it would look something like this:
 |       |        |       |
 |   1   |    2   |       |
 |----------------|   3   |
 |                |       |
 |                |-------|
 |       5        |       |
 |                |   4   |
 |        |       |       |
 |   6    |   7   |   8   |
 |        |       |       |
 |            |           |
 |     9      |     10    |

Open in new window

So what my goal is is to get the current image I am wanting to place into a box and get its width and height and from that determine the best box to place it in so that it will show the image:

- Without black borders on either the left/right or top/bottom (or both).
- Not chop off the important areas of the image (mostly the middle section moving out).

I have decided to use Magick.NET in order to ease the pain of doing something like this from scratch. So when I determine what box I will be placing the image into then I can use the Magick.NET to crop it using:

Resize with something like this:
imgStream.Crop(width, height, Gravity.Center);

Open in new window

MagickGeometry size = new MagickGeometry(width, height);
size.IgnoreAspectRatio = maintainAspectRatio;
// Adjust geometry offset to center of image (same as `-gravity Center`)
size.Y = imgStream.Height / 2 - height / 2;
size.X = imgStream.Width / 2 - width / 2;

Open in new window

So to sum up the above - I am in need of finding the best box to place the image into before I go and use Magick.NET on it.
Free Tool: SSL Checker
LVL 12
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

How to install Resharper on Visual Studio 2017?

I have the license ID handy, but forgot how.

A coworker posted a report definition (.rdl) file out onto the server, asking that I help her with adding some fields from some tables to several of the data sets for the report.  I imported the report into Visual Studio (2010 SP1), but each of the data sets had a DataSource property which was not defined in my solution explorer.  If I tried to edit the data set in the query designer I received an error message:

An Error occurred while connecting to the data source.  Only the text-based query designer will be available.
Additional information:
The shared data source 'Kermit' does not exist or you do not have permissions.  For more information, contact your report server administrator.

So I created a new shared data source with that name, pointing it to the appropriate Server and database, but I'm still getting that error.

If I change the data source to another previously defined data source, which works for other reports in my VS solution, I can open the data sets and run the queries just fine in the query designer.  But when I try to preview this report I'm getting an error:

An error occurred during local report processing.
Error in the Application.
Could not find a part of the path '\\servername\gpshare\SRS_Projects\GPReports\GPReports\Maestro FP\Maestro FP\Maestro FP\bin\debug\data sources\MaestroFP.rds'

The \Data Sources\ folder does not exist on this path, but the rest of that path does exist.  I cannot figure out where this path for the …
I am installing a Visual Studio 2017 application developed on .NET framework 4.5.
The client does not use Microsoft SQL Server but I would like to use SSRS for reporting. Is there a standalone SSRS that can provide reporting without Microsoft SQL Server installed.
I am trying to use VS 2008 to change the startup form to a form that was imported (frmOpenPDF) from another project, but I get a “the type or namespace could not be found” error. The screen shots show the details.
 No error for the default form1:
Default FormProject Browser
ProjectObject Browser (no frmOpenPDF)
New FormThe error
ErrorPlease help the resolve error.
Issue with MS Build. Trying to set up a queue from VSTS and failing in build solution.

Here is the desc.

Starting: Build solution
Task         : Visual Studio Build
Description  : Build with MSBuild and set the Visual Studio version property
Version      : 1.126.0
Author       : Corporation
Help         : [More Information](
"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.126.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.126.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json
"C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe" "D:\a\1\s\$\CodeBase\ToolDevBranch3.32\rei.sln" /nologo /nr:false /t:"Clean" …
I want an Button to form that will display my computer's IP address,, how can I do this? Thanks in advance.

Microsoft Visual Studio





Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code.